Greg Erskine wrote: 
> Maybe....just maybe....
> 
> Way back somewhere I mentioned using the "force" option instead of the
> "stop" option during testing.
> 

Thanks Greg.  I had noticed the 'force' option, but hadn't looked beyond
the comment: "# Force should only be used for testing purposes."

But now I see that it's a brute force replacement for the 'restart'
option.  So I've given it a try on my own setup, i.e. I replaced 

Code:
--------------------
    result="$(sudo /usr/local/etc/init.d/squeezelite restart)"
--------------------

with

Code:
--------------------
    result="$(sudo /usr/local/etc/init.d/squeezelite force)"
--------------------


And now - the weirdest thing - Squeezelite won't restart on my test
setup!  The running process is killed, and the PIDFILE is deleted, but
the part of the init.d script that does the 'start', i.e. '$0 start',
doesn't seem to do anything.  I understand that this should re-run the
init.d script with the 'start' option, and therefore I should see one of
the two echoed messages in my log file, but I see neither, and there's
no new Squeezelite process afterwards.

For reference, here's the bit of the init.d script that does the 'force'
restart:

Code:
--------------------
        force)
                # Force should only be used for testing purposes.
                echo "Forcing a restart of $PNAME..."
                if [ -f $PIDFILE ]; then
                        sudo kill `cat $PIDFILE`
                        sudo rm -f $PIDFILE
                fi
                sudo ps | grep squeezelite | grep -v grep | awk '{print $1}' | 
xargs kill -9
                sleep 1
                $0 start
                ;;
--------------------


I see the 'Forcing...' message echoed in my log file, the PIDFILE
disappears, and the squeezelite process is killed.  But there's no
evidence that '$0 start' is even being triggered.

And for reference, here's the 'start' part of the init.d script - I
should at least get one of the two echoed messages in the log file.


Code:
--------------------
        start)
                if [ -f $PIDFILE ]; then
                        echo "$PNAME already running."
                        exit 1
                fi
                echo "Starting $DESC: $PNAME..."
                start-stop-daemon --start --quiet -b -m -p $PIDFILE --exec 
$DAEMON -- -n "$NAME" $OUTPUT $ALSA_PARAMS $BUFFER_SIZE $_CODEC $XCODEC 
$PRIORITY $MAX_RATE $UPSAMPLE $MAC_ADDRESS $SERVER_IP $LOGLEVEL $DSDOUT $VIS 
$CLOSEOUT $UNMUTE $ALSAVOLUME $LIRC $POWER_GPIO $POWER_SCRIPT $OTHER
                ;;
--------------------


I think it's time for me to sleep on this and look at it again with a
fresh pair of eyes tomorrow.


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

Reply via email to