wok rev 9670

openerp-web: fix init script
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 02 16:23:17 2011 +0200 (2011-05-02)
parents 6bb38e7c0524
children 57fa27788226
files openerp-web/stuff/etc/init.d/openerp-web
line diff
     1.1 --- a/openerp-web/stuff/etc/init.d/openerp-web	Mon May 02 15:57:40 2011 +0200
     1.2 +++ b/openerp-web/stuff/etc/init.d/openerp-web	Mon May 02 16:23:17 2011 +0200
     1.3 @@ -15,9 +15,10 @@
     1.4  PIDFILE=/var/run/openerp-web.pid
     1.5  [ -n "$OPTIONS" ] || OPTIONS="-c /etc/openerp/openerp-web.conf"
     1.6  
     1.7 +ps ww | grep $DAEMON | awk '{ if (!/grep/) print $1 }' > $PIDFILE
     1.8  case "$1" in
     1.9  	start)
    1.10 -		if [ -f $PIDFILE ] ; then
    1.11 +		if active_pidfile $PIDFILE $NAME ; then
    1.12  			echo "$NAME already running."
    1.13  			exit 1
    1.14  		fi
    1.15 @@ -26,7 +27,7 @@
    1.16  		status
    1.17  		sleep 2 ;;
    1.18  	stop)
    1.19 -		if [ ! -f $PIDFILE ] ; then
    1.20 +		if ! active_pidfile $PIDFILE $NAME ; then
    1.21  			echo "$NAME is not running."
    1.22  			exit 1
    1.23  		fi
    1.24 @@ -35,7 +36,7 @@
    1.25  		status
    1.26  		sleep 2 ;;
    1.27  	restart)
    1.28 -		if [ ! -f $PIDFILE ] ; then
    1.29 +		if ! active_pidfile $PIDFILE $NAME ; then
    1.30  			echo "$NAME is not running."
    1.31  			exit 1
    1.32  		fi