Do not start SPS as s6 service to avoid passing arguments via -e

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2023-03-07 22:08:11 +01:00
parent f79c3e1579
commit b6e691263e
17 changed files with 33 additions and 27 deletions
+6
View File
@@ -113,3 +113,9 @@ RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio && addgr
# Remove anything we don't need.
RUN rm -rf /lib/apk/db/*
# Add run script that will start SPS
COPY ./docker/run.sh ./run.sh
RUN chmod +x /run.sh
Entrypoint ["/init","./run.sh"]
+3 -3
View File
@@ -31,12 +31,12 @@ $ docker run -d --restart unless-stopped --net host --device /dev/snd \
### Options
To pass command line options to Shairport Sync they need to be set with `-e ARG=`. Here is an example:
Command line options will be passed to Shairport Sync. Here is an example:
```
$ docker run -d --restart unless-stopped --net host --device /dev/snd \
-e ARG="-v --statistics -a DenSystem -d hw:0 -c PCM" \
mikebrady/shairport-sync:latest
mikebrady/shairport-sync:latest \
-v --statistics -a DenSystem -d hw:0 -c PCM
```
This will send audio to alsa hardware device `hw:0` and make use of the that device's mixer control called `PCM`. The service will be visible as `DenSystem` on the network.
+6
View File
@@ -91,3 +91,9 @@ RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio && addgr
# Remove anything we don't need.
RUN rm -rf /lib/apk/db/*
# Add run script that will start SPS
COPY ./docker/run.sh ./run.sh
RUN chmod +x /run.sh
Entrypoint ["/init","./run.sh"]
@@ -1,6 +1,6 @@
#!/command/with-contenv sh
while [ ! -f /var/run/dbus/dbus.pid ]; do
echo "s6-rc: warning: dbus is not running, sleeping for 1 seconds before trying to start avahi"
echo "s6-rc: warning: dbus is not running, sleeping for 1 second before trying to start avahi"
sleep 1
done
echo "Starting avahi"
@@ -1 +0,0 @@
03-avahi
@@ -1,2 +0,0 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
@@ -1,7 +0,0 @@
#!/command/with-contenv sh
while [ ! -f /var/run/avahi-daemon/pid ]; do
echo "s6-rc: warning: avahi is not running, sleeping for 1 seconds before trying to start shairport-sync"
sleep 1
done
echo "Starting shairport-sync"
exec /usr/local/bin/shairport-sync $ARG
@@ -1 +0,0 @@
longrun
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
while [ ! -f /var/run/avahi-daemon/pid ]; do
echo "Warning: avahi is not running, sleeping for 1 second before trying to start shairport-sync"
sleep 1
done
echo "Starting shairport-sync"
# pass all commandline options to shairport-sync
/usr/local/bin/shairport-sync "$@"
+1 -1
View File
@@ -1,6 +1,6 @@
#!/command/with-contenv sh
while [ ! -f /var/run/dbus/dbus.pid ]; do
echo "s6-rc: warning: dbus is not running, sleeping for 1 seconds before trying to start avahi"
echo "s6-rc: warning: dbus is not running, sleeping for 1 second before trying to start avahi"
sleep 1
done
echo "Starting avahi"
@@ -1 +0,0 @@
04-nqptp
@@ -1,2 +0,0 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
@@ -1,7 +0,0 @@
#!/command/with-contenv sh
while [ ! -f /var/run/avahi-daemon/pid ]; do
echo "s6-rc: warning: avahi is not running, sleeping for 1 seconds before trying to start shairport-sync"
sleep 1
done
echo "Starting shairport-sync"
exec /usr/local/bin/shairport-sync $ARG
@@ -1 +0,0 @@
longrun
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
while [ ! -f /var/run/avahi-daemon/pid ]; do
echo "Warning: avahi is not running, sleeping for 1 second before trying to start shairport-sync"
sleep 1
done
echo "Starting shairport-sync"
# pass all commandline options to shairport-sync
/usr/local/bin/shairport-sync "$@"