Git Product home page Git Product logo

Comments (13)

calmh avatar calmh commented on May 26, 2024

Yeah, it's both. But in a full crash the exit code can be anything really, for example 128+signal number.

from docs.

Nutomic avatar Nutomic commented on May 26, 2024

The thing is, I didnt treat this exit code as an error in the Android app, which lead to that issue. So the documentation should say that exit code 2 can also mean a crash. And even in a crash, the exit code should never be 0, 3 or 4, right?

from docs.

calmh avatar calmh commented on May 26, 2024

You'll only ever get exit code 2 in the meaning of "upgrade not available" when running syncthing -upgrade or syncthing -upgrade-check specifically. I can't really guarantee what the exit code is or isn't in a crash as at that point someone else (the Go runtime, or the OS) has taken over. I'd be surprised if it was zero, though. For the other codes, does it really matter? Syncthing exited with something that was not the intention to stay shutdown forever, so the action to take is restart it regardless?

from docs.

Nutomic avatar Nutomic commented on May 26, 2024

So how can I check for shutdown, restart or crash in the Android wrapper?
https://github.com/syncthing/syncthing-android/blob/master/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java#L152

from docs.

calmh avatar calmh commented on May 26, 2024

Shutdown is zero. Anything else is a restart or a crash so you restart it. If you want to be more specific, three is an intentional restart and everything else is a crash and thus unintentional restart.

from docs.

Nutomic avatar Nutomic commented on May 26, 2024

I dont want to restart every time, because shutdown is also handled via exit codes. And errors should be reported, so they dont cause an infinite loop. So how about this:
0 -> shutdown
137 -> shutdown (sigkill)
3 -> restart
else -> error

from docs.

calmh avatar calmh commented on May 26, 2024

Sure, if you prefer. The way our monitor process does it is that it restarts on nonzero exit. If there are four restarts in 15 seconds or so it concludes there is a problem and gives up.

from docs.

Catfriend1 avatar Catfriend1 commented on May 26, 2024

Hi,
I'm currently investigating a ticket where the user got exit code 2 unexpectedly. Does that mean it's an upgrade problem or panic in recent syncthing versions? The main.go code says "upgradeNotFound" but upgrades are always off on Android.

from docs.

AudriusButkevicius avatar AudriusButkevicius commented on May 26, 2024

Check the logs

from docs.

Catfriend1 avatar Catfriend1 commented on May 26, 2024

It got lost in crash and it's not my phone, so how?

from docs.

AudriusButkevicius avatar AudriusButkevicius commented on May 26, 2024

Idk. 2 means upgrade, if it happened in some other case you'd need to get the logs.

from docs.

Catfriend1 avatar Catfriend1 commented on May 26, 2024

Okay, maybe the user can provide logs or info if he did try to turn on the non existing upgrade feature in the app. Afaik the web ui doesn't allow turning it on due to compiler switches used during build.

from docs.

AudriusButkevicius avatar AudriusButkevicius commented on May 26, 2024

You can't switch it on once it was disabled at compile time.

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.