From 7c5ef745659f383fff01a6254782a0b64e1838ee Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 1 Dec 2016 16:37:46 +0800 Subject: [PATCH] Become process group leader when updating firmware As exec is invoked, child process can not ignore the signal sent to the process group, use setpgrp to set the pgid to itself. close-issue: #1849 --- xCAT-server/lib/xcat/plugins/ipmi.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5f72fa77d..1138bac9b 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1924,6 +1924,11 @@ sub do_rflash_process { # child elsif ($pid == 0) { + unless (setpgrp()) { + xCAT::SvrUtils::sendmsg([ 1, "Faild to run setgprp for $$ process" ], + $callback, $node); + exit(1); + } my $extra = $_[8]; my @exargs = @$extra; my $programe = \$0;