X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=dnsmasq.init;h=c744ab2b24ca61cc9ea0f28228fba46b5c34790d;hb=d93a2c0ccb07c826c7d9b572bf57770bf90c83aa;hp=31c325d2e827946e588928bfa9ce7162f7c3ab4f;hpb=4932272be3b87bc33d358fbfc00dc73155a677fd;p=packages%2Fdnsmasq.git diff --git a/dnsmasq.init b/dnsmasq.init index 31c325d..c744ab2 100644 --- a/dnsmasq.init +++ b/dnsmasq.init @@ -2,7 +2,7 @@ # # Startup script for the DNS caching server # -# chkconfig: 2345 99 01 +# chkconfig: 345 14 89 # description: This script starts your DNS caching server # processname: dnsmasq # pidfile: /var/run/dnsmasq.pid @@ -20,9 +20,13 @@ CMD=$SERVICE . /etc/sysconfig/network # Check that networking is up -if is_no "$NETWORKING"; then - msg_Network_Down $MSG - exit 1 +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down $MSG + exit 1 + fi +else + exit 0 fi MAILHOSTNAME="" @@ -39,42 +43,41 @@ OPTIONS="" [ -n "$RESOLV_CONF" ] && OPTIONS="$OPTIONS -r $RESOLV_CONF" [ -n "$DHCP_LEASE" ] && OPTIONS="$OPTIONS -l $DHCP_LEASE" [ -n "$DOMAIN_SUFFIX" ] && OPTIONS="$OPTIONS -s $DOMAIN_SUFFIX" +[ -n "$INTERFACE" ] && OPTIONS="$OPTIONS -i $INTERFACE" +RETVAL=0 # See how we were called. case "$1" in start) if [ ! -f "$LOCKFILE" ]; then msg_starting $MSG - daemon $CMD $OPTIONS + daemon $CMD $OPTIONS RETVAL=$? - [ $RETVAL -eq 0 ] && touch $LOCKFILE + [ $RETVAL -eq 0 ] && touch $LOCKFILE else - msg_Already_Running $MSG - exit 1 + msg_already_running $MSG fi - ;; + ;; stop) if [ -f "$LOCKFILE" ]; then msg_stopping $MSG - killproc $CMD + killproc $CMD rm -f $LOCKFILE >/dev/null 2>&1 else - msg_Not_Running $MSG - exit 1 - fi - ;; + msg_not_running $MSG + fi + ;; status) status $CMD - exit $? ;; - restart|reload) + restart|force-reload) $0 stop $0 start + exit $? ;; *) - msg_Usage "$0 {start|stop|restart|reload|status}" - exit 1 + msg_usage "$0 {start|stop|restart|force-reload|status}" + exit 3 esac exit $RETVAL -