MINOR: startup: change session/process group settings
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 4 Jul 2018 13:31:23 +0000 (15:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Jul 2018 17:29:56 +0000 (19:29 +0200)
commitbfd8eb590908f1f326d3da214197f0fff7788435
treee9fe702bc64377bffe7b940bd2b89b864284b1c9
parent70d318ccb760ee25f166a75d163f38545f074ff1
MINOR: startup: change session/process group settings

Change the way the process groups are set. Indeed setsid() was called
for every processes which caused the worker to have a different process
group than the master.

This patch behave in a better way:

- In daemon mode only, each child do a setsid()
- In master worker + daemon mode, the setsid() is done in the master before
forking the children
- In any foreground mode, we don't do a setsid()

Could be backported in 1.8 but the master-worker mode is mostly used
with systemd which rely on cgroups so that won't affect much people.
src/haproxy.c