kill child process if xcat command stopped by signal
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3884 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
4bbc896185
commit
0a6dc4ad6e
@ -219,7 +219,12 @@ sub do_rnetboot {
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
if ( !open( OUTPUT, "$cmd 2>&1 |")) {
|
||||
my $pid = open( OUTPUT, "$cmd 2>&1 |");
|
||||
$SIG{INT} = $SIG{TERM} = sub { #prepare to process job termination and propogate it down
|
||||
kill 9, $pid;
|
||||
exit 0;
|
||||
};
|
||||
if ( !$pid ) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
#######################################
|
||||
|
@ -294,9 +294,15 @@ sub do_getmacs {
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
if ( !open( OUTPUT, "$cmd 2>&1 |")) {
|
||||
my $pid = open( OUTPUT, "$cmd 2>&1 |");
|
||||
$SIG{INT} = $SIG{TERM} = sub { #prepare to process job termination and propogate it down
|
||||
kill 9, $pid;
|
||||
exit 0;
|
||||
};
|
||||
if ( !$pid ) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Get command output
|
||||
#######################################
|
||||
|
Loading…
Reference in New Issue
Block a user