From: Daniel Hokka Zakrisson Date: Sat, 5 Mar 2011 13:45:42 +0000 (+0000) Subject: Create a new session before running rc-script. X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b30eee53f811b1fa1a4a21f84466ab79c9f422c0;p=util-vserver.git Create a new session before running rc-script. This fixes the problem of killall5 not killing stray processes because they are in the same session as the shell, if both vserver start and vserver stop are run from the same session. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2939 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/src/vcontext.c b/src/vcontext.c index 1ec45a8..1e23637 100644 --- a/src/vcontext.c +++ b/src/vcontext.c @@ -368,6 +368,10 @@ doit(struct Arguments const *args, int argc, char *argv[]) doExternalSync(ext_sync_fd, args->sync_msg); doSyncStage1(p, args->do_disconnect); DPRINTF("doit: pid=%u, ppid=%u\n", getpid(), getppid()); + + if (args->do_migrateself) + setsid(); + if (!args->do_vlogin) execvp (argv[optind],argv+optind); else