You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doesn't react to Ctrl-C when run in a subshell with -no-restart (Linux) #4774
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Syncthing won't get and exit due to a Ctrl-C. If the last line is exec syncthing ... it's all good as then there is no intermediate shell.
Another workaround is to not use -no-restart, as the monitor process will then handle this correctly, getting the Ctrl-C and passing the signal to its child. And honestly this is the expected way to run when running "interactively" anyway.
This is due to the process group juggling in c554ffc, 91210cb, c2119c9. The controlling terminal sends the signal to the foreground process group, which in this case is just bash (as we move away into our own process group).
BSD, Mac, etc don't suffer from this as they have sane thread implementations where we don't need to do tricks with the process group.
A potential "fix" could be to have the monitor process do this instead, by using runtime.LockOSThread, setting the niceness for the current thread, then syscall.ForkExec to spawn the real syncthing from that thread, inheriting the priority. I'm not very fond of moving stuff into the monitor.
Or we could just remove the hack and tell Linux users to set the niceness themselves. Or maybe just let this be a known issue forever.
changed the title [-]Doesn't react to Ctrl-C when run in a subshell (Linux)[/-][+]Doesn't react to Ctrl-C when run in a subshell with -no-restart (Linux)[/+]on Feb 25, 2018
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
[-]Doesn't react to Ctrl-C when run in a subshell (Linux)[/-][+]Doesn't react to Ctrl-C when run in a subshell with -no-restart (Linux)[/+]cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes …
cmd/syncthing: Always use monitor process (fixes #4774, fixes #5786) (#…
Merge branch 'master' into db/trans
Merge branch 'master' into badgermerge
Merge branch 'master' into encryption