mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
BUG/MEDIUM: init: make sure only daemonized processes change their session
Commit 8dd4efe42f ("MAJOR: mworker: move master-worker fork in init()") introduced some sensitive changes to the startup code (which was expected), and one sensitive change is that the second call to setsid() was accidentally made unconditional. As such it even applies to foreground processes, resulting in foreground processes being detached from the terminal and no longer responding to Ctrl-C nor Ctrl-Z. An example of this simply consists in start haproxy -db under sudo. Then a new shell is required to stop it. This patch removes this second setsid(), as it is already done in apply_daemon_mode(). This must be backported to 3.1.
This commit is contained in:
parent
6404b7a18a
commit
70e4938aec
@ -3603,7 +3603,6 @@ int main(int argc, char **argv)
|
||||
devnullfd = -1;
|
||||
}
|
||||
pid = getpid(); /* update pid */
|
||||
setsid();
|
||||
fork_poller();
|
||||
|
||||
/* pass through every cli socket, and check if it's bound to
|
||||
|
Loading…
x
Reference in New Issue
Block a user