kill (from within ash) and /bin/kill (linked to busybox) are the same
program, almost.  The version in ash has to first handle job ids ("kill
%2"), but then the common code is called.  start-stop-daemon doesn't
invoke a kill program at all.  Like any reasonable program, it simply
invokes the kill() system call itself.

But decades of doing shell programming on unix/linux tell me that your
problem isn't because kill isn't doing its job.  There's something else
wrong -- either kill isn't really being invoked, or its trying to kill
the wrong process, or the pidfile contains the wrong pid, or something.

Regarding the script /usr/local/etc/init.d/squeezelite:   if it finds
/var/run/squeezelite it thinks it's running.  If it doesn't find it, it
thinks it's not.  That would be fine, except:

If I kill squeezelite manually, with killall squeezelite, or pkill
squeezelite, the processes go away, but the pid file remains.

If (after removing /var/run/squeezelite.pid) I invoke
"/usr/local/etc/init.d/squeezelite start" *without* sudo, squeezelite
will happily start, running as the user "tc", but the pidfile won't be
created (because tc doesn't have permissions to write to /var/run).
Running the script again whether as tc or as root, yields "Squeezelite
is not running.", simply because the pid file doesn't exist.

Alternatively, if I run the ".../squeezelite start" with sudo, and then
run the "stop" without sudo, then of course the processes are left
running (tc doesn't have permission to kill them), but the pidfile is
removed!!  That's because the init.d script uses "sudo rm -f $PIDFILE". 
Sigh.  If it's going to remove the pid file with sudo, it should invoke
start-stop-daemon with sudo.  But really, why is a system script using
sudo at all??

I think there are a lot of places where scripts and test cases can go
wrong without needing to investigate the kill command itself.

paul


------------------------------------------------------------------------
pgf's Profile: http://forums.slimdevices.com/member.php?userid=58510
View this thread: http://forums.slimdevices.com/showthread.php?t=113661

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to