Dear Maintainer,
hpsockd enter daemon status by itself therefor start-stop-daemon can not create
the proper pid file, which causes the script fail to stop daemon.
Invoke start-stop-daemon with --name instead of --pidfile fix the problem.
---
debian/init.d | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/debian/init.d b/debian/init.d
index 72f7e90..f0417a5 100755
--- a/debian/init.d
+++ b/debian/init.d
@@ -13,14 +13,24 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/hpsockd
NAME=hpsockd
+WORKDIR=/var/cache/$NAME
DESC="HP SOCKS daemon"
test -f $DAEMON || exit 0
set -e
+check_hpsockd_dir()
+{
+ if [ ! -d $WORKDIR ]; then
+ mkdir -m 755 $WORKDIR
+ chown nobody:root $WORKDIR
+ fi
+}
+
case "$1" in
start)
+ check_hpsockd_dir
if [ -f /etc/hpsockd.conf ]; then
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
@@ -32,8 +42,7 @@ case "$1" in
;;
stop)
echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
- --exec $DAEMON
+ start-stop-daemon --stop --quiet --name $NAME
echo "$NAME."
;;
reload|force-reload)
@@ -42,8 +51,7 @@ case "$1" in
;;
restart)
echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON
+ start-stop-daemon --stop --quiet --name $NAME
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
--
1.7.10.4