[CRIU] [PATCH 01/28] pid_ns: Set sid for root_item

Kirill Tkhai ktkhai at virtuozzo.com
Mon Jun 5 20:23:33 MSK 2017


Temporary functionality until complete setsid() support
is implemented. This is need to make tests with "--iter"
working in jenkins.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/cr-restore.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 7c449af47..a609a1ed9 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1505,8 +1505,11 @@ static void restore_sid(void)
 {
 	pid_t sid;
 
-	if (!list_empty(&top_pid_ns->children))
+	if (!list_empty(&top_pid_ns->children)) {
+		if (current == root_item)
+			setsid();
 		return;
+	}
 	/*
 	 * SID can only be reset to pid or inherited from parent.
 	 * Thus we restore it right here to let our kids inherit



More information about the CRIU mailing list