[PATCH] restart: respond to (mimic) signal (if --copy-status asked)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In --copy-status mode, the coordinator waits for the restarted
root-task and mimics the way it exits: either by exiting with the same
exit status, or by sending the same fatal signal to self.

In the latter case of the signal, we need to ensure that the default
behavior of that signal is set, or may not kill us.

Signed-off-by: Oren Laadan <orenl@xxxxxxxxxxxxxxx>
---
 restart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/restart.c b/restart.c
index cb81293..54da220 100644
--- a/restart.c
+++ b/restart.c
@@ -773,6 +773,7 @@ static int ckpt_parse_status(int status, int mimic, int verbose)
 	if (mimic) {
 		if (sig) {
 			ckpt_dbg("mimic sig %d\n", sig);
+			signal(sig, SIG_DFL);  /* so kill() affects us */
 			kill(_getpid(), sig);
 		} else {
 			ckpt_dbg("mimic ret %d\n", ret);
-- 
1.6.0.4

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux