fixed start/stop
authorheiko
Wed, 30 Jul 2014 10:42:46 +0200
changeset 41 bd4aaf436891
parent 40 c5127a2c4f81
child 42 d298433f2ef5
child 46 92cbdc24b0fd
fixed start/stop pidof(8) scans the first field of /proc/<pid>/cmdline. tele-watch sets $0 to 'tele-watch <list of watchpoints>', this in turn sets argv[0], the /proc/<pid>/cmdline. The name we need to look for with pidof is 'tele-watch <list of watchpoints>'.
init.d.in
--- a/init.d.in	Wed Jul 30 10:34:23 2014 +0200
+++ b/init.d.in	Wed Jul 30 10:42:46 2014 +0200
@@ -49,7 +49,7 @@
 	#   0 if daemon has been started
 	#   0 if daemon was already running
 	#   2 if daemon could not be started
-	PID=$(pidof $NAME) && return 0
+	PID=$(pidof "$NAME $WATCHPOINTS") && return 0
 	
 	if [ ! $PID ]; then
 		$DAEMON "$WATCHPOINTS" || return 2
@@ -67,7 +67,7 @@
 	#   0 if daemon was already stopped
 	#   2 if daemon could not be stopped
 	#   other if a failure occurred
-	PID=$(pidof $NAME) || return 0
+	PID=$(pidof "$NAME $WATCHPOINTS") || return 0
 
 	$DAEMON --kill || return 2
 	return 0