Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.46k stars 1.24k forks source link

Document how to ensure bash-script processes exit properly #772

Open edbrannin opened 8 years ago

edbrannin commented 8 years ago

It would be rather helpful if the Subprocess page in supervisor's documentation mentioned the fixes listed in How to propagate SIGTERM to a child process in a Bash script.

Short version: if supervisor is starting a bash-wrapper around another process, that wrapper should either:

  1. exec the other process on its last line
  2. Explicitly handle the SIGTERM with trap/wait
mnaberez commented 8 years ago
  1. exec the other process on its last line

This is the preferred method. exec replaces the current process with a new one, and the supervisord can signal the new one directly. I'll leave this issue open until we add something to the documentation.