From: Mike Brady Date: Mon, 20 Aug 2018 21:44:27 +0000 (+0100) Subject: Tidy the init.d script up a little more to reflect the true situation upon (attempted... X-Git-Tag: 3.3RC0~249^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92bd0254e35c831cd2616a1df3b41cf9f0802366;p=thirdparty%2Fshairport-sync.git Tidy the init.d script up a little more to reflect the true situation upon (attempted) startup --- diff --git a/scripts/shairport-sync.in b/scripts/shairport-sync.in index 46d8c5fc..f229f19b 100755 --- a/scripts/shairport-sync.in +++ b/scripts/shairport-sync.in @@ -47,19 +47,19 @@ do_start() { # Return # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - [ -e /var/run/shairport-sync ] || ( mkdir -p /var/run/shairport-sync && chown shairport-sync:shairport-sync /var/run/shairport-sync ) ; \ - start-stop-daemon -c shairport-sync:shairport-sync --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ - || return 1 + # 1 if PID directory didn't exist and couldn't be created with approproate permission + # 2 if daemon was already running + # 3 if daemon could not be started + [ -e /var/run/shairport-sync ] || ( mkdir -p /var/run/shairport-sync && chown shairport-sync:shairport-sync /var/run/shairport-sync ) || return 1 + start-stop-daemon -c shairport-sync:shairport-sync --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 2 # This script is set to start running after all other services have started. # However, if you find that Shairport Sync is still being started before what it needs is ready, # uncomment the next line to get the script to wait for three seconds before attempting to start Shairport Sync. # sleep 3 - # Shairport Sync reads settings from the configuration file (/etc/shairport-sync.conf by default) and will then apply any command line options. - start-stop-daemon -c shairport-sync:shairport-sync --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d || return 2 + # Settings from the configuration file (@sysconfdir@/shairport-sync.conf by default) + start-stop-daemon -c shairport-sync:shairport-sync --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d || return 3 } #