Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding dbus and avahi to enable shairport-sync to work correctly #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN set -ex \
&& echo "**** install runtime packages ****" \
&& apk add --no-cache -U --upgrade \
alsa-utils \
dbus \
librespot@testing \
shairport-sync@testing \
snapcast \
Expand Down
9 changes: 9 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-avahi/data/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
state="$(dbus-send --system --dest=org.freedesktop.Avahi --print-reply / org.freedesktop.Avahi.Server.GetState | grep int32 | awk '{printf $2}')"

# Avahi will return 'state=2' when 'Server startup complete'
if [ "$state" = 2 ]; then
exit 0
else
exit 1
fi
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-avahi/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-avahi/notification-fd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
4 changes: 4 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-avahi/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash

echo "Starting avahi"
exec s6-notifyoncheck avahi-daemon --no-chroot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-avahi/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
2 changes: 2 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-dbus/data/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec dbus-send --system / org.freedesktop.DBus.Peer.Ping > /dev/null 2> /dev/null
Empty file.
2 changes: 2 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-dbus/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/command/execlineb -S0
/run/s6/basedir/bin/halt
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-dbus/notification-fd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
5 changes: 5 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-dbus/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash

echo "Starting dbus"
mkdir -p /var/run/dbus
exec s6-notifyoncheck dbus-daemon --system --nofork --nopidfile
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/svc-dbus/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
Empty file.