Paul Webster wrote: > Given that the situation is relatively rare and that an extra few > seconds is unlikely to make a difference then a > SIGHUP then pause and check again and SIGKILL if still running should be > OK.
Do you mean as a general purpose approach for the init.d script? For this USB DAC script, I see no harm in using SIGKILL immediately. Is there anything important that Squeezelite would have wanted to do first if given the chance? If it can't do that, does it matter, given that the DAC has gone? Here's where I'm currently at with pgf's script. I separated the start/stop tasks into their own function (the commands are only wrapped inside 'log' commands to keep the log file tidy): Code: -------------------- squeezelite() { case $1 in start) log $(/usr/local/etc/init.d/squeezelite start 2>&1) ;; stop) # log $(/usr/local/etc/init.d/squeezelite stop 2>&1) log "Stopping Squeezelite player: Squeezelite..." result=$(start-stop-daemon --stop --quiet -s SIGKILL -p /var/run/squeezelite.pid 2>&1) if [ "$result" ]; then log $result; fi sudo rm -f /var/run/squeezelite.pid ;; esac } -------------------- ------------------------------------------------------------------------ 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 unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix