From bc6b0712c3bf8e4c61c5b2fb80598de73a12a972 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 15 Mar 2012 15:46:54 +0000 Subject: [PATCH] Refine tftp startup handling to cope better with more states (dealing with xinetd reconfiged or not reconfiged, xinetd without tftp slave active and with slave active) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11872 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 792f1fe14..53c9fb29f 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -1461,15 +1461,12 @@ sub enable_TFTPhpa { # error xCAT::MsgUtils->message("S", "Error on command: service xinetd start\n"); - return 1; } - return 0; } } # /usr/sbin/in.tftpd -V # tftp-hpa 0.49, with remap, with tcpwrappers # - system("/usr/sbin/in.tftpd -v -l -s /tftpboot -m /etc/tftpmapfile4xcat.conf"); @@ -1484,6 +1481,14 @@ sub enable_TFTPhpa #} #xCAT::MsgUtils->message("S", " The tftp-hpa has been reconfigured."); } + if (-x "/usr/sbin/in.tftpd") { + system("killall in.tftpd"); #xinetd can leave behind blocking tftp servers even if it won't start new ones + my @tftpprocs=`ps axf|grep -v grep|grep in.tftpd`; + while (@tftpprocs) { + sleep 0.1; + } + system("/usr/sbin/in.tftpd -v -l -s /tftpboot -m /etc/tftpmapfile4xcat.conf"); + } return 0; }