Hmm - well this is odd. I can make the kill command work if I specify
the location of the binary, i.e. 'sudo /bin/kill -9 $PID'. But I don't
understand that, because the path available to the script when called by
udev, although rather shorter than for a normal user shell, does contain
/bin:
Code:
--------------------
/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
--------------------
The same applies to rm - I have to specify the full path to the binary,
i.e. 'sudo /bin/rm -f $PIDFILE'.
Very strange - I'd be interested if anyone can explain why this is.
But at least it could explain why things were getting out of sync.
With this workaround I can now get the forced stop to work properly. It
turns out that I can replace
Code:
--------------------
sudo /usr/local/etc/init.d/squeezelite restart
--------------------
with
Code:
--------------------
sudo /usr/local/etc/init.d/squeezelite start
--------------------
and it all works fine. I can do this because the script only needs to
start and stop squeezelite - it shouldn't need to -re-start it if things
remain in sync. Nevertheless I may anyway include a forced stop before
calling the above init.d start, so that it mimics the normal restart
option. Attempting to stop it if it isn't running I doesn't do any
harm.
So since the start-stop-daemon is able to do the start function but not
the restart function, it suggests that the start-stop-daemon might also
be using 'kill' to do the stopping, and perhaps the same issue arises -
for some reason it's not finding kill without the full path. On some
RPis ?
I'll rework the script and tidy it up and post a complete script for
Bogg to try.
------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=113661
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix