[ps-watcher] 48/88: adjust init script since daemon supports writing pidfiles

Jan Wagner waja at alioth.debian.org
Fri Nov 8 23:06:40 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository ps-watcher.

commit 6d3ebb24e857f7be3610b057253b5b83bbd77d27
Author: Jan Wagner <waja at cyconet.org>
Date:   Wed Apr 2 21:38:04 2008 +0000

    adjust init script since daemon supports writing pidfiles
---
 debian/changelog |    4 ++++
 debian/init.d    |   10 +++-------
 debian/preinst   |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

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 <waja at cyconet.org>  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#

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/ps-watcher.git



More information about the Pkg-perl-cvs-commits mailing list