adjust init script since daemon supports writing pidfiles

This commit is contained in:
Jan Wagner 2008-04-02 21:38:04 +00:00
parent bd1517fc23
commit 6d3ebb24e8
3 changed files with 8 additions and 8 deletions

4
debian/changelog vendored
View file

@ -5,6 +5,10 @@ ps-watcher (1.06-9) unstable; urgency=low
* change Priority to extra since libconfig-inifiles-perl is also extra and * change Priority to extra since libconfig-inifiles-perl is also extra and
we depend on it we depend on it
* remove whitespaces trailing whitespaces from changelog * 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 <waja@cyconet.org> Sun, 09 Dec 2007 23:12:51 +0100 -- Jan Wagner <waja@cyconet.org> Sun, 09 Dec 2007 23:12:51 +0100

10
debian/init.d vendored
View file

@ -61,28 +61,24 @@ case "$1" in
echo -n "Starting $DESC: " echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid
echo "$NAME." echo "$NAME."
;; ;;
stop) stop)
echo -n "Stopping $DESC: " echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
--exec $DAEMON
echo "$NAME." echo "$NAME."
;; ;;
restart|force-reload) restart|force-reload)
echo -n "Restarting $DESC: " echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
--exec $DAEMON
sleep 1 sleep 1
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS --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." echo "$NAME."
;; ;;
*) *)
N=/etc/init.d/$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 echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1 exit 1
;; ;;

2
debian/preinst vendored
View file

@ -3,6 +3,6 @@ set -e
# generate correct pid file, for versions where was non or incorrect # generate correct pid file, for versions where was non or incorrect
if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" <= "1.06-6"; then 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 fi
#DEBHELPER# #DEBHELPER#