Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upmake managing multiprocess services easier and safer #16
Conversation
acg
added some commits
Mar 24, 2014
acg
referenced this pull request
Mar 24, 2014
Closed
optionally setsid and transparently use process group control #3
added a commit
that referenced
this pull request
Mar 25, 2014
bruceg
merged commit 1c95026
into
bruceg:master
Mar 25, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
acg commentedMar 24, 2014
These changes make managing multiprocess services with daemontools-encore easier and safer. An example of a multiprocess service is one with a long-running shell pipeline in its ./run file.
Multiprocess services were problematic for classic daemontools, and are still somewhat problematic for daemontools-encore. Prior to this change, signalling multiprocess services under the latter could result in orphaned processes, unclean system shutdown, and problems with ^Z and ^C when running in a foreground terminal. These issues are addressed by propagating certain signals to services, and by signalling the entire process group when a service uses setsid.
This change also introduces compatibility with classic daemontools, which did not use a new process group for each service. To avoid using a new process group for a service, create a file ./no-setsid in the service directory. To explicitly signal just the process leader of a setsid service, use
svc -+. To explicitly signal the entire process group of a no-setsid service, usesvc -=.This change is a refactor and rebase of #3. (You may find some more information there.)