Skip to contentSkip to conversation

have restart return error if error

PATCH In review Serge E. Hallyn 2 participants 3 messages Oct 15, 2009 – Oct 17, 2009 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 have restart return error if error

I still need this for cr_tests/userns/run_simple.sh to succeed. All tests pass with this patch applied.

---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
restart.c +1 -1
index cb81293..fa786ef 100644
@@ -780,7 +780,7 @@ static int ckpt_parse_status(int status, int mimic, int verbose)
 		}
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ckpt_collect_child(struct ckpt_ctx *ctx)
Signature · 1 line
1.6.1.1

A message that is not in the archive (sent off-list or not yet received): 20091015184935.GB30490-r/[email protected]

#2 lore raw
Quoted 3 lines · Serge E. Hallyn

I still need this for cr_tests/userns/run_simple.sh to succeed. All tests pass with this patch applied.

But this is not the intended behavior.

The coordinator will:

1) If restart fails, exit with an error status (>0)

2) If restart succeeds, exit immediately with status 0 (--no-wait), or (by default) wait for the restart root-task to exit, and then exit with success status 0, regardless of the exit status (or reason) of the restarted root-task.

What you want is that the coordinator instead will report the exit status of the restart root-task. You can use the --copy-status command line switch for that.

The intended behavior is that if the restarted root-task died due to a signal, then so will the coordinator (if --copy-status is requested). I now see that this part needs a small fix - to ensure that the signal is not handled by the coordinator. Will fix that.

Oren.

Quoted 18 lines
---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
restart.c +1 -1
index cb81293..fa786ef 100644
@@ -780,7 +780,7 @@ static int ckpt_parse_status(int status, int mimic, int verbose)
 		}
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ckpt_collect_child(struct ckpt_ctx *ctx)

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 11 lines · Oren Laadan
Quoted 3 lines · Serge E. Hallyn

I still need this for cr_tests/userns/run_simple.sh to succeed. All tests pass with this patch applied.

But this is not the intended behavior.

The coordinator will:

1) If restart fails, exit with an error status (>0)

But restart is failing, and the coordinator is not exiting with error status.

Quoted 35 lines

2) If restart succeeds, exit immediately with status 0 (--no-wait), or (by default) wait for the restart root-task to exit, and then exit with success status 0, regardless of the exit status (or reason) of the restarted root-task.

What you want is that the coordinator instead will report the exit status of the restart root-task. You can use the --copy-status command line switch for that.

The intended behavior is that if the restarted root-task died due to a signal, then so will the coordinator (if --copy-status is requested). I now see that this part needs a small fix - to ensure that the signal is not handled by the coordinator. Will fix that.

Oren.

Quoted 18 lines
---
 restart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
restart.c +1 -1
index cb81293..fa786ef 100644
@@ -780,7 +780,7 @@ static int ckpt_parse_status(int status, int mimic, int verbose)
 		}
 	}
 
-	return 0;
+	return ret;
 }
 
 static int ckpt_collect_child(struct ckpt_ctx *ctx)