mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-09 08:00:51 +00:00
Merge pull request #2258 from tych0/fix-signal-sending-to-lxc-init
fix signal sending in lxc.init
This commit is contained in:
commit
83ffaa1d39
@ -380,6 +380,12 @@ static int signal_handler(int fd, uint32_t events, void *data,
|
|||||||
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (siginfo.ssi_signo != SIGCHLD) {
|
||||||
|
kill(hdlr->pid, siginfo.ssi_signo);
|
||||||
|
INFO("Forwarded signal %d to pid %d", siginfo.ssi_signo, hdlr->pid);
|
||||||
|
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* More robustness, protect ourself from a SIGCHLD sent
|
/* More robustness, protect ourself from a SIGCHLD sent
|
||||||
* by a process different from the container init.
|
* by a process different from the container init.
|
||||||
*/
|
*/
|
||||||
@ -389,12 +395,6 @@ static int signal_handler(int fd, uint32_t events, void *data,
|
|||||||
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (siginfo.ssi_signo != SIGCHLD) {
|
|
||||||
kill(hdlr->pid, siginfo.ssi_signo);
|
|
||||||
INFO("Forwarded signal %d to pid %d", siginfo.ssi_signo, hdlr->pid);
|
|
||||||
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (siginfo.ssi_code == CLD_STOPPED) {
|
if (siginfo.ssi_code == CLD_STOPPED) {
|
||||||
INFO("Container init process was stopped");
|
INFO("Container init process was stopped");
|
||||||
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
return hdlr->init_died ? LXC_MAINLOOP_CLOSE : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user