Supervisor / supervisor

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

Supervisord only forks once on daemonize. #1028

Closed thornycrackers closed 6 years ago

thornycrackers commented 6 years ago

Hello!

In the _daemonize function inside of supervisor/options.py I noticed that supervisord is only forking once. There is a comment that references an article on http://www.cems.uwe.ac.uk/~irjohnso/coursenotes/lrc/system/daemons/d3.htm. It mentions forking once can still leave your process as a session leader so the solution is to fork a second time. I don't know if this is really much of an issue or if the second fork is absolutely necessary but I didn't see any previous mentions of this in previous issues and thought it might hold some significance.

mnaberez commented 6 years ago

The article mentioned above is referenced in the code in question (here). I assume the code's original author(s) read the article since it is called out specifically, along with passages from Stevens' "Advanced Unix Programming" book. This code has existed in supervisord for some ten years now without any issues reported, so I'm reluctant to change it arbitrarily now. Since this issue report doesn't seem rooted in a bug being observed, I'm going to close this issue for now. We can reopen if the code in question is seen causing an actual issue.