Package: dsyslog Version: 0.6.0+b1 Severity: normal Tags: patch The initscript acts a little weird in a couple of ways. I've attached a patch that fixes them. The problems:
1. the start happens faster than /proc/$pid can be created, and as a
result, it thinks that it didn't start properly and spits an error. This
is due to the start case doing:
if start_server && running ; then
which starts and immediately checks to see if it is running. A simple
addition of a 'sleep 1' after the start solves that problem.
2. The pid file isn't removed when the stop action is called. It is
removed when the start action is called, which is a bit weird because if
you call start twice, you end up screwing up the pid file
unnecessarily. The patch fixes that.
3. minor spacing issues fixed for consistancy
--- /etc/init.d/dsyslog 2009-07-16 13:11:14.000000000 -0400
+++ /tmp/dsyslog 2011-04-27 10:35:08.197940278 -0400
@@ -80,10 +80,10 @@
pid=$1
name=$2
[ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
+ [ ! -d /proc/$pid ] && return 1
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
# Is this the expected server
- [ "$cmd" != "$name" ] && return 1
+ [ "$cmd" != "$name" ] && return 1
return 0
}
@@ -99,10 +99,10 @@
}
start_server() {
- rm -f $PIDFILE
start-stop-daemon --start --quiet --pidfile $PIDFILE --background
--make-pidfile --oknodo \
--exec $DAEMON -- $DAEMON_OPTS
errcode=$?
+ sleep 1
return $errcode
}
@@ -119,7 +119,7 @@
--exec $DAEMON
errcode=$?
fi
-
+ if [ $errcode -eq 0 ]; then rm -f $PIDFILE; fi
return $errcode
}
pgp5EUl5Kvxhg.pgp
Description: PGP signature

