From 9e4fd9ef384ef6f64cf159fad965beb28eb76e78 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 5 Dec 2012 03:04:13 +0000 Subject: [PATCH] set all the plugin procress and its children in a seperate process group;send SIGTERM to the process group to effectively abort command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14553 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 444927ce3..b44762e3d 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1245,6 +1245,7 @@ sub plugin_command { die; } if ($child == 0) { + setpgrp(0,0); if ($parfd) { #If xCAT is doing multiple requests in same communication PID, things would get unfortunate otherwise $parent_fd = $parfd; } @@ -1988,7 +1989,7 @@ sub relay_fds { #Relays file descriptors from pipes to children to the SSL socke print "Aborting..."; foreach (keys %plugin_children) { print "Sending INT to $_\n"; - kill 15, $_; + kill -15, $_; } foreach my $cin ($fds->handles) { print $cin "die\n";