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>'.
--- 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