From 6b96496d1bf2e9447f6b686b6e0ad85629945d27 Mon Sep 17 00:00:00 2001 From: wangxiaopeng Date: Fri, 3 Jun 2016 04:16:07 -0400 Subject: [PATCH] issue 1233: try to rekill tftp and add more debug info when failed to kill tftpd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 5d4a73ca5..fa351187f 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -1429,8 +1429,13 @@ sub enable_TFTPhpa foreach my $pid (keys %pids_map) { if (xCAT::Utils->is_process_exists($pid)) { $count++; - if($count > 5) { - xCAT::MsgUtils->message("S","ERROR: Can not stop tftp process in 5 seconds."); + if($count == 5) { + my $tftpinfo = `ps axf|grep -v grep|grep in.tftpd`; + xCAT::MsgUtils->message("S","ERROR: Can not stop tftp process $pid [$tftpinfo] in 5 seconds, stop it again."); + system("killall -s KILL in.tftpd"); + } + if($count > 10) { + xCAT::MsgUtils->message("S","ERROR: Can not stop tftp process in 10 seconds."); return 1; } sleep 1;