# HG changeset patch # User Pascal Bellard # Date 1304346197 -7200 # Node ID bca15a7af6a1779e2b51e39beb13eb0c953ac9eb # Parent 6bb38e7c0524abd3a2317620eb922793b546b8f1 openerp-web: fix init script diff -r 6bb38e7c0524 -r bca15a7af6a1 openerp-web/stuff/etc/init.d/openerp-web --- a/openerp-web/stuff/etc/init.d/openerp-web Mon May 02 15:57:40 2011 +0200 +++ b/openerp-web/stuff/etc/init.d/openerp-web Mon May 02 16:23:17 2011 +0200 @@ -15,9 +15,10 @@ PIDFILE=/var/run/openerp-web.pid [ -n "$OPTIONS" ] || OPTIONS="-c /etc/openerp/openerp-web.conf" +ps ww | grep $DAEMON | awk '{ if (!/grep/) print $1 }' > $PIDFILE case "$1" in start) - if [ -f $PIDFILE ] ; then + if active_pidfile $PIDFILE $NAME ; then echo "$NAME already running." exit 1 fi @@ -26,7 +27,7 @@ status sleep 2 ;; stop) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE $NAME ; then echo "$NAME is not running." exit 1 fi @@ -35,7 +36,7 @@ status sleep 2 ;; restart) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE $NAME ; then echo "$NAME is not running." exit 1 fi