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

Oren Laadan orenl at librato.com
Sun Oct 18 19:53:41 PDT 2009


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 at cs.columbia.edu>
---
 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 at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list