]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Move creation of the /var/run/shairport-sync directory from install time to just...
authorMike Brady <mikebrady@eircom.net>
Mon, 20 Aug 2018 21:28:36 +0000 (22:28 +0100)
committerMike Brady <mikebrady@eircom.net>
Mon, 20 Aug 2018 21:28:36 +0000 (22:28 +0100)
Makefile.am
scripts/shairport-sync.in

index cc88b5302624f4b2cf13ebc8c3e1f978b81a88b8..635b4aea32a2c781643788cde1e7eb9727f23e26 100644 (file)
@@ -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
index e65e51e653d39318ffe0290a71aee098be8d3328..46d8c5fcdaf959bbd09d7ee3354f5778b7f9be1a 100755 (executable)
@@ -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