Dev/1.0.11 - #13
Merged
Merged
Conversation
After an in-app update Inari quit and stayed down whenever it was running
from the autostart unit. Two things had to go wrong together:
- restart_app spawns "setsid sh -c 'sleep 2; exec /usr/bin/inari'" and
exits. setsid gets a new session but stays in the service's cgroup,
and KillMode defaults to control-group, so systemd sweeps the helper
up the moment the main process exits - during its sleep, before it
ever reaches the exec.
- The unit has Restart=on-failure, and quitting in order to restart is
a clean exit, so systemd did not step in either. Restart=always would
be wrong: it would make quitting from the tray impossible.
Reproduced both: a service running the same setsid pattern leaves no
trace of its helper, and the journal for the 1.0.9 -> 1.0.10 upgrade
shows the unit exiting with status=0 one second after dpkg and never
coming back.
When we are the unit, ask systemd to restart it and let the job outlive
us. --no-block matters: the first half of that job is stopping this very
process, so a blocking call would wait on our own death.
Detection deliberately does not use INVOCATION_ID. systemd sets it for
every unit, and KDE wraps a manual launch in a transient
app-<name>@<hash>.service - restarting inari.service from inside one of
those would start a unit the user never asked for and orphan the
launched instance. The cgroup path names the unit we are actually in.
Verified against both real cgroups from this machine.
Off systemd - AppImage, a direct launch - the existing relauncher is
still the right answer and is untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix start after update