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
This commit is contained in:
jbjohnso 2012-03-15 15:46:54 +00:00
parent 6d92251583
commit bc6b0712c3

View File

@ -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;
}