-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent ssh process from receiving SIGINT, SIGQUIT
Certain signals can be generated by the terminal based on user input (for example, Ctrl-C -> SIGINT). The generated signals are sent not just to the process the user considers to be foreground but to all processes in the foreground process group. As a consequence, if one process needs the other(s) to do cleanup before terminating, it's no longer possible. This happens to Unison when it tries to do cleanup with the remote server. The ssh process has already died and the remote connection is broken. To prevent the ssh process from terminating too early, block some signals (here, SIGINT and SIGQUIT) before spawning the ssh child process. Child processes inherit the signal mask and signal settings so blocking some signals before spawning effectively blocks these signals for the ssh process (unless it changes the sigmask for itself).
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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