diff -ruNp a/dnsmasq-2.50/contrib/rpm/dnsmasq.init b/dnsmasq-2.50/contrib/rpm/dnsmasq.init --- a/contrib/rpm/dnsmasq.init 1969-12-31 21:00:00.000000000 -0300 +++ b/contrib/rpm/dnsmasq.init 2009-10-05 04:25:25.512657061 -0300 @@ -0,0 +1,110 @@ +#!/bin/sh +# +# Startup script for the DNS caching server +# +# chkconfig: - 49 50 +# description: This script starts your DNS caching server +# processname: dnsmasq +# pidfile: /var/run/dnsmasq.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 6 + +exec="/usr/sbin/dnsmasq" +prog="dnsmasq" +config="/etc/sysconfig/dnsmasq" + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog + +DOMAIN_SUFFIX=`dnsdomainname` +if [ ! -z "${DOMAIN_SUFFIX}" ]; then + OPTIONS="-s $DOMAIN_SUFFIX" +fi + + +start() { + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 + echo -n $"Starting $prog: " + daemon "$exec $OPTIONS $OPTS" + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc "$prog" + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $prog: " + killproc "$prog" -HUP + retval=$? + echo + return $retval +} + +force_reload() { + restart +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $?