changeset 2:06f06306e3f4

Fix the init.d script - Fix DAEMON path; - Use the --pidfile option landing with 1.1.0
author Louis Opter <kalessin@kalessin.fr>
date Sat, 07 Nov 2015 18:24:19 -0800
parents a1d629cc9a21
children 11534a873dbc
files debian/init.d
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/debian/init.d	Sat Nov 07 10:24:58 2015 +0000
+++ b/debian/init.d	Sat Nov 07 18:24:19 2015 -0800
@@ -17,7 +17,7 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="lightsd"
 NAME=lightsd
-DAEMON=/usr/sbin/lightsd
+DAEMON=/usr/bin/lightsd
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -31,6 +31,7 @@
     --daemonize
     --verbosity warning
     --user lightsd
+    --pidfile $PIDFILE
     --socket /var/run/lightsd/socket
     --command-pipe /var/run/lightsd/pipe
     $DAEMON_OPTS
@@ -52,8 +53,7 @@
 	#   2 if daemon could not be started
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
-	start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- \
-		$DAEMON_ARGS \
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
 		|| return 2
 }
 
@@ -64,7 +64,7 @@
 	#   1 if daemon was already stopped
 	#   2 if daemon could not be stopped
 	#   other if a failure occurred
-	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --remove-pidfile --name $NAME
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
 	# Wait for children to finish too if this is a daemon that forks