wok-4.x rev 3886

perdition: ensure pidfile are valid
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 12 18:13:06 2009 +0200 (2009-08-12)
parents b7e5667bff37
children eaabe08708e2
files perdition/stuff/etc/init.d/perdition
line diff
     1.1 --- a/perdition/stuff/etc/init.d/perdition	Wed Aug 12 12:50:40 2009 +0200
     1.2 +++ b/perdition/stuff/etc/init.d/perdition	Wed Aug 12 18:13:06 2009 +0200
     1.3 @@ -21,7 +21,7 @@
     1.4    start)
     1.5      for i in $PROTOCOLS; do
     1.6        [ -s /etc/perdition/perdition.$i.conf ] || continue
     1.7 -      if [ -f $PIDFILE.$i/perdition.$i.pid ] ; then
     1.8 +      if active_pidfile $PIDFILE.$i/perdition.$i.pid perdition.$i ; then
     1.9          echo "$NAME ($i) already running."
    1.10  	continue
    1.11        fi
    1.12 @@ -34,7 +34,7 @@
    1.13    stop)
    1.14      for i in $PROTOCOLS; do
    1.15        [ -s /etc/perdition/perdition.$i.conf ] || continue
    1.16 -      if [ ! -f $PIDFILE.$i/perdition.$i.pid ] ; then
    1.17 +      if ! active_pidfile $PIDFILE.$i/perdition.$i.pid perdition.$i ; then
    1.18          echo "$NAME ($i) is not running."
    1.19  	continue
    1.20        fi
    1.21 @@ -46,7 +46,7 @@
    1.22    restart)
    1.23      for i in $PROTOCOLS; do
    1.24        [ -s /etc/perdition/perdition.$i.conf ] || continue
    1.25 -      if [ ! -f $PIDFILE.$i/perdition.$i.pid ] ; then
    1.26 +      if ! active_pidfile $PIDFILE.$i/perdition.$i.pid perdition.$i ; then
    1.27          echo "$NAME ($i) is not running."
    1.28  	continue
    1.29        fi
    1.30 @@ -61,7 +61,7 @@
    1.31    reload)
    1.32      for i in $PROTOCOLS; do
    1.33        [ -s /etc/perdition/perdition.$i.conf ] || continue
    1.34 -      [ -f $PIDFILE.$i/perdition.$i.pid ] && \
    1.35 +      active_pidfile $PIDFILE.$i/perdition.$i.pid perdition.$i && \
    1.36  		kill -1 `cat $PIDFILE.$i/perdition.$i.pid`
    1.37        status
    1.38      done