wok rev 11693

lxnetdaemon: update start script
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 18 17:39:51 2012 +0100 (2012-02-18)
parents b6858242c35f
children 6cf4a602d2f2
files lxnetdaemon/stuff/etc/init.d/lxnetdaemon
line diff
     1.1 --- a/lxnetdaemon/stuff/etc/init.d/lxnetdaemon	Sat Feb 18 17:35:06 2012 +0100
     1.2 +++ b/lxnetdaemon/stuff/etc/init.d/lxnetdaemon	Sat Feb 18 17:39:51 2012 +0100
     1.3 @@ -11,20 +11,21 @@
     1.4  NAME=LXnetdaemon
     1.5  DESC="Network daemon"
     1.6  DAEMON=/usr/bin/lxnetdaemon
     1.7 -PIDFILE=/var/run/lxnetdaemon.socket
     1.8 +PIDFILE=/var/run/lxnetdaemon.pid
     1.9  
    1.10  case "$1" in
    1.11    start)
    1.12 -    if [ -f $PIDFILE ] ; then
    1.13 +    if active_pidfile $PIDFILE lxnetdaemon ; then
    1.14        echo "$NAME already running."
    1.15        exit 1
    1.16      fi
    1.17      echo -n "Starting $DESC: $NAME... "
    1.18      $DAEMON $OPTIONS 
    1.19      status
    1.20 +    pidof lxnetdaemon > $PIDFILE
    1.21      ;;
    1.22    stop)
    1.23 -    if [ ! -f $PIDFILE ] ; then
    1.24 +    if ! active_pidfile $PIDFILE lxnetdaemon ; then
    1.25        echo "$NAME is not running."
    1.26        exit 1
    1.27      fi
    1.28 @@ -34,7 +35,7 @@
    1.29      status
    1.30      ;;
    1.31    restart)
    1.32 -    if [ ! -f $PIDFILE ] ; then
    1.33 +    if ! active_pidfile $PIDFILE lxnetdaemon ; then
    1.34        echo "$NAME is not running."
    1.35        exit 1
    1.36      fi
    1.37 @@ -44,6 +45,7 @@
    1.38      sleep 2
    1.39      $DAEMON $OPTIONS
    1.40      status
    1.41 +    pidof lxnetdaemon > $PIDFILE
    1.42      ;;
    1.43    *)
    1.44      echo ""