From 948931c59beb44e6e3db9840fdc157d82b67b6a1 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 26 Jun 2008 13:52:36 +0000 Subject: [PATCH] -Fixup tftpd init script for RHEL4/SLES10/RHEL5 --- atftp/atftp.spec | 2 +- atftp/tftpd | 34 ++++++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/atftp/atftp.spec b/atftp/atftp.spec index 4f7488f..0075afa 100644 --- a/atftp/atftp.spec +++ b/atftp/atftp.spec @@ -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 diff --git a/atftp/tftpd b/atftp/tftpd index e38a8b2..c3b42d3 100755 --- a/atftp/tftpd +++ b/atftp/tftpd @@ -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