bruceg/daemontools-encore — pull request #16 by acg (2014-03-24 02:04:23+00:00)
Title: make managing multiprocess services easier and safer

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, use `svc -=`.

This change is a refactor and rebase of #3. (You may find some more information there.)