adjust init script since daemon supports writing pidfiles
Jan Wagner
16 years ago
4 | 4 |
* change Priority to extra since libconfig-inifiles-perl is also extra and
|
5 | 5 |
we depend on it
|
6 | 6 |
* remove whitespaces trailing whitespaces from changelog
|
|
7 |
* add dpatch infrastructure
|
|
8 |
* add 01_add_pidfile_support.dpatch to implement writing pidfiles into the
|
|
9 |
daemon
|
|
10 |
* adjust init script since the daemon supports writing pidfiles
|
7 | 11 |
|
8 | 12 |
-- Jan Wagner <waja@cyconet.org> Sun, 09 Dec 2007 23:12:51 +0100
|
9 | 13 |
|
60 | 60 |
echo -n "Starting $DESC: "
|
61 | 61 |
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
62 | 62 |
--exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
|
63 | |
ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid
|
64 | 63 |
echo "$NAME."
|
65 | 64 |
;;
|
66 | 65 |
stop)
|
67 | 66 |
echo -n "Stopping $DESC: "
|
68 | |
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
|
69 | |
--exec $DAEMON
|
|
67 |
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
|
70 | 68 |
echo "$NAME."
|
71 | 69 |
;;
|
72 | 70 |
restart|force-reload)
|
73 | 71 |
echo -n "Restarting $DESC: "
|
74 | |
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
|
75 | |
--exec $DAEMON
|
|
72 |
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
|
76 | 73 |
sleep 1
|
77 | 74 |
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
78 | 75 |
--exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
|
79 | |
ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid
|
|
76 |
/bin/pidof $DAEMON > /var/run/$NAME.pid
|
80 | 77 |
echo "$NAME."
|
81 | 78 |
;;
|
82 | 79 |
*)
|
83 | 80 |
N=/etc/init.d/$NAME
|
84 | |
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
85 | 81 |
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
86 | 82 |
exit 1
|
87 | 83 |
;;
|
2 | 2 |
|
3 | 3 |
# generate correct pid file, for versions where was non or incorrect
|
4 | 4 |
if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" <= "1.06-6"; then
|
5 | |
ps aux | grep /usr/bin/ps-watcher | head -1 | awk '{ print $2 }' > /var/run/ps-watcher.pid
|
|
5 |
/bin/pidof ps-watcher > /var/run/ps-watcher.pid
|
6 | 6 |
fi
|
7 | 7 |
#DEBHELPER#
|