--- cauldron/dhcp/current/SOURCES/dhcrelay.init 2011/09/05 09:13:09 138690 +++ cauldron/dhcp/current/SOURCES/dhcrelay.init 2011/09/05 09:17:05 138691 @@ -1,33 +1,27 @@ #!/bin/sh # -# dhcrelay This shell script takes care of starting and stopping -# dhcrelay. -# -# chkconfig: 2345 65 35 -# description: dhcrelay provides the DHCP Relay service. -# -# processname: dhcrelay -# pidfile: /var/run/dhcrelay.pid -# ### BEGIN INIT INFO # Provides: dhcrelay -# Required-Start: $network -# Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: -# Short-Description: The dhcrelay daemon -# Description: dhcrelay provides the DHCP Relay service. +# Should-Start: +# Required-Start: $network +# Required-Stop: $network +# Short-Description: Start and stop the DHCP relay server +# Description: dhcrelay provides the Dynamic Host Configuration Protocol (DHCP) +# relay server. This is required when your DHCP server is on +# another network segment from the clients. ### END INIT INFO +# +# The fields below are left around for legacy tools (will remove later). +# +# chkconfig: - 65 35 +# description: dhcrelay provides a relay for Dynamic Host Control Protocol. +# processname: dhcrelay +# # pidfile: /var/run/dhcrelay.pid -# Source function library. . /etc/rc.d/init.d/functions -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - [ -x /usr/sbin/dhcrelay ] || exit 0 # The following variables can be set in the file @@ -53,52 +47,52 @@ RETVAL=0 start() { - # Start daemons. - echo -n "Starting dhcrelay: " - daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay - return $RETVAL + # Start daemons. + echo -n "Starting dhcrelay: " + daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay + return $RETVAL } stop() { - # Stop daemons. - echo -n "Shutting down dhcrelay: " - killproc dhcrelay - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay - return $RETVAL + # Stop daemons. + echo -n "Shutting down dhcrelay: " + killproc dhcrelay + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay + return $RETVAL } # See how we were called. case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - stop - start - RETVAL=$? - ;; - condrestart) - if [ -f /var/lock/subsys/dhcrelay ]; then - stop - start - RETVAL=$? - fi - ;; - status) - status dhcrelay - RETVAL=$? - ;; - *) - echo "Usage: dhcrelay {start|stop|restart|condrestart|status}" - exit 1 + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/dhcrelay ]; then + stop + start + RETVAL=$? + fi + ;; + status) + status dhcrelay + RETVAL=$? + ;; + *) + echo "Usage: dhcrelay {start|stop|restart|condrestart|status}" + exit 1 esac exit $RETVAL