From: Mike Brady Date: Mon, 20 Aug 2018 21:28:36 +0000 (+0100) Subject: Move creation of the /var/run/shairport-sync directory from install time to just... X-Git-Tag: 3.3RC0~249^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=711b6e64139b8e3906b50c5e26fba4f503edcd7f;p=thirdparty%2Fshairport-sync.git Move creation of the /var/run/shairport-sync directory from install time to just before launch -- it may be deleted when the machine is powered down. --- diff --git a/Makefile.am b/Makefile.am index cc88b530..635b4aea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -144,8 +144,6 @@ endif if INSTALL_SYSTEMV getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null - [ -e /var/run/shairport-sync ] || mkdir -p /var/run/shairport-sync - chown shairport-sync:shairport-sync /var/run/shairport-sync [ -e $(DESTDIR)$(sysconfdir)/init.d ] || mkdir -p $(DESTDIR)$(sysconfdir)/init.d [ -f $(DESTDIR)$(sysconfdir)/init.d/shairport-sync ] || cp scripts/shairport-sync $(DESTDIR)$(sysconfdir)/init.d/ endif diff --git a/scripts/shairport-sync.in b/scripts/shairport-sync.in index e65e51e6..46d8c5fc 100755 --- a/scripts/shairport-sync.in +++ b/scripts/shairport-sync.in @@ -49,6 +49,7 @@ do_start() # 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