# HG changeset patch # User Pascal Bellard # Date 1249905415 -7200 # Node ID c88819f363158bb331681a34c6153ae2b687f33e # Parent cb5d40864a83bef71d91c46fb1e1f82daa9a0222 Busybox: ensure pidfile are valid diff -r cb5d40864a83 -r c88819f36315 busybox/stuff/dnsd --- a/busybox/stuff/dnsd Mon Aug 10 13:16:15 2009 +0200 +++ b/busybox/stuff/dnsd Mon Aug 10 13:56:55 2009 +0200 @@ -16,16 +16,16 @@ case "$1" in start) - if [ -f $PIDFILE ] ; then + if active_pidfile $PIDFILE dnsd ; then echo "$NAME already running." exit 1 fi echo -n "Starting $DESC: $NAME... " - $DAEMON $OPTIONS + $DAEMON $OPTIONS && echo `pidof $DAEMON` > $PIDFILE status ;; stop) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE dnsd ; then echo "$NAME is not running." exit 1 fi @@ -35,7 +35,7 @@ status ;; restart) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE dnsd ; then echo "$NAME is not running." exit 1 fi diff -r cb5d40864a83 -r c88819f36315 busybox/stuff/udhcpd --- a/busybox/stuff/udhcpd Mon Aug 10 13:16:15 2009 +0200 +++ b/busybox/stuff/udhcpd Mon Aug 10 13:56:55 2009 +0200 @@ -16,7 +16,7 @@ case "$1" in start) - if [ -f $PIDFILE ] ; then + if active_pidfile $PIDFILE udhcpc ; then echo "$NAME already running." exit 1 fi @@ -25,7 +25,7 @@ status ;; stop) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE udhcpc ; then echo "$NAME is not running." exit 1 fi @@ -34,7 +34,7 @@ status ;; restart) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE udhcpc ; then echo "$NAME is not running." exit 1 fi diff -r cb5d40864a83 -r c88819f36315 busybox/stuff/zcip --- a/busybox/stuff/zcip Mon Aug 10 13:16:15 2009 +0200 +++ b/busybox/stuff/zcip Mon Aug 10 13:56:55 2009 +0200 @@ -7,16 +7,18 @@ # . /etc/init.d/rc.functions . /etc/daemons.conf +. /etc/network.conf NAME=Zcip DESC="ZeroConf deamon" DAEMON=/sbin/zcip OPTIONS=$ZCIP_OPTIONS PIDFILE=/var/run/zcip.pid +[ -n "$OPTIONS" ] || OPTIONS="$INTERFACE /etc/zcip.script" case "$1" in start) - if [ -f $PIDFILE ] ; then + if active_pidfile $PIDFILE zcip ; then echo "$NAME already running." exit 1 fi @@ -25,7 +27,7 @@ status ;; stop) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE zcip ; then echo "$NAME is not running." exit 1 fi @@ -35,7 +37,7 @@ status ;; restart) - if [ ! -f $PIDFILE ] ; then + if ! active_pidfile $PIDFILE zcip ; then echo "$NAME is not running." exit 1 fi