X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdhcdbd.git;a=blobdiff_plain;f=dhcdbd.init;fp=dhcdbd.init;h=51277c98e5b93b39cc2aafc914760b0e8ff96f70;hp=b4541cb30b5732a863152198efa142f43e21ec1d;hb=7c37a40f01fe98d2ac1beb4b3b15d36ba08324d4;hpb=720b723925f5ef4d77fde23009b29a1563aed5eb diff --git a/dhcdbd.init b/dhcdbd.init index b4541cb..51277c9 100644 --- a/dhcdbd.init +++ b/dhcdbd.init @@ -9,7 +9,8 @@ # processname: dhcdbd # pidfile: /var/run/dhcdbd.pid # config: /etc/dbus-1/system.d/dhcdbd.conf - +# +# $Id$ # Source function library . /etc/rc.d/init.d/functions @@ -30,10 +31,7 @@ else exit 0 fi -RETVAL=0 -# See how we were called. -case "$1" in - start) +start() { if [ -f /var/lock/subsys/messagebus ]; then if [ ! -f /var/lock/subsys/dhcdbd ]; then msg_starting dhcdbd @@ -46,8 +44,9 @@ case "$1" in else msg_not_running messagebus fi - ;; - stop) +} + +stop() { msg_stopping dhcdbd if [ -f /var/run/dhcdbd.pid ]; then checkpid `cat /var/run/dhcdbd.pid` >/dev/null 2>&1 @@ -77,6 +76,20 @@ case "$1" in else msg_not_running messagebus fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start ;; status) status dhcdbd @@ -98,10 +111,6 @@ case "$1" in fi fi ;; - restart) - $0 stop - $0 start - ;; *) msg_usage "$0 {start|stop|restart|status}" exit 3