[Devel] [PATCH 2/2] Explicitly set pgid and sid of init
sukadev at us.ibm.com
sukadev at us.ibm.com
Thu Feb 22 15:24:42 PST 2007
From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Subject: [PATCH 2/2] Explicitly set pgid and sid of init
Explicitly set pgid and sid of init process to 1.
Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Cedric Le Goater <clg at fr.ibm.com>
Cc: Dave Hansen <haveblue at us.ibm.com>
Cc: Serge Hallyn <serue at us.ibm.com>
Cc: Eric Biederman <ebiederm at xmission.com>
Cc: containers at lists.osdl.org
---
init/main.c | 1 +
kernel/exit.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
Index: lx26-20-mm2/init/main.c
===================================================================
--- lx26-20-mm2.orig/init/main.c 2007-02-21 14:31:26.000000000 -0800
+++ lx26-20-mm2/init/main.c 2007-02-21 15:34:06.000000000 -0800
@@ -791,6 +791,7 @@ static int __init init(void * unused)
*/
init_pid_ns.child_reaper = current;
+ __set_special_pids(1, 1);
cad_pid = task_pid(current);
smp_prepare_cpus(max_cpus);
Index: lx26-20-mm2/kernel/exit.c
===================================================================
--- lx26-20-mm2.orig/kernel/exit.c 2007-02-21 15:33:57.000000000 -0800
+++ lx26-20-mm2/kernel/exit.c 2007-02-21 15:34:06.000000000 -0800
@@ -296,12 +296,12 @@ void __set_special_pids(pid_t session, p
{
struct task_struct *curr = current->group_leader;
- if (process_session(curr) != session) {
+ if (pid_nr(task_session(curr)) != session) {
detach_pid(curr, PIDTYPE_SID);
set_signal_session(curr->signal, session);
attach_pid(curr, PIDTYPE_SID, find_pid(session));
}
- if (process_group(curr) != pgrp) {
+ if (pid_nr(task_pgrp(curr)) != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
curr->signal->pgrp = pgrp;
attach_pid(curr, PIDTYPE_PGID, find_pid(pgrp));
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
More information about the Devel
mailing list