2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-22 01:21:44 +00:00

-Fixup tftpd init script for RHEL4/SLES10/RHEL5

This commit is contained in:
jbjohnso 2008-06-26 13:52:36 +00:00
parent 6aa18b64c1
commit 948931c59b
2 changed files with 25 additions and 11 deletions

View File

@ -2,7 +2,7 @@ Name: atftp
Summary: Advanced Trivial File Transfer Protocol (ATFTP) - TFTP server
Group: System Environment/Daemons
Version: 0.7
Release: 6
Release: 7
License: GPL
Vendor: Linux Networx Inc.
Source: atftp_0.7.dfsg.orig.tar.gz

View File

@ -12,6 +12,16 @@
### END INIT INFO
RHSuccess()
{
success
echo
}
RHFailure()
{
failure
echo
}
MStatus()
{
ps ax|grep -v grep|grep atftpd >& /dev/null
@ -25,20 +35,20 @@ MStatus()
return $RVAL
}
if [ -f /lib/lsb/init-functions ]; then
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
START_DAEMON=daemon
STATUS=MStatus
LOG_SUCCESS=RHSuccess
LOG_FAILURE=RHFailure
LOG_WARNING=passed
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
START_DAEMON=start_daemon
STATUS=MStatus
LOG_SUCCESS=log_success_msg
LOG_FAILURE=log_failure_msg
LOG_WARNING=log_warning_message
elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
START_DAEMON=daemon
STATUS=MStatus
LOG_SUCCESS=success
LOG_FAILURE=failure
LOG_WARNING=passed
else
echo "Error, don't know how to start on this platform"
exit 1
@ -54,11 +64,15 @@ status)
;;
stop)
echo -n "Stopping ATFTP "
killproc atftpd
if killproc atftpd; then
$LOG_SUCCESS
else
$LOG_FAILURE
fi
;;
start)
echo -n "Starting ATFTP "
$START_DAEMON atftpd --group nobody --daemon && $LOG_SUCCESS || $LOG_FAILURE
$START_DAEMON /usr/sbin/atftpd --group nobody --daemon && $LOG_SUCCESS || $LOG_FAILURE
;;
esac