diff --git a/debian/changelog b/debian/changelog index 1bcd5a8..119caca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,10 @@ ps-watcher (1.06-9) unstable; urgency=low * change Priority to extra since libconfig-inifiles-perl is also extra and we depend on it * remove whitespaces trailing whitespaces from changelog + * add dpatch infrastructure + * add 01_add_pidfile_support.dpatch to implement writing pidfiles into the + daemon + * adjust init script since the daemon supports writing pidfiles -- Jan Wagner Sun, 09 Dec 2007 23:12:51 +0100 diff --git a/debian/init.d b/debian/init.d index 4362fd4..dfadeb5 100644 --- a/debian/init.d +++ b/debian/init.d @@ -61,28 +61,24 @@ case "$1" in echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS - ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid echo "$NAME." ;; stop) echo -n "Stopping $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid sleep 1 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS - ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid + /bin/pidof $DAEMON > /var/run/$NAME.pid echo "$NAME." ;; *) N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; diff --git a/debian/preinst b/debian/preinst index 513e294..36daa0b 100755 --- a/debian/preinst +++ b/debian/preinst @@ -3,6 +3,6 @@ set -e # generate correct pid file, for versions where was non or incorrect if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" <= "1.06-6"; then - ps aux | grep /usr/bin/ps-watcher | head -1 | awk '{ print $2 }' > /var/run/ps-watcher.pid + /bin/pidof ps-watcher > /var/run/ps-watcher.pid fi #DEBHELPER#