try systemd

This commit is contained in:
Alexandre
2024-04-26 10:57:34 +02:00
parent 9fbd9b3f67
commit 8cd23d0d11
16 changed files with 38 additions and 19 deletions

View File

@@ -1,4 +1,14 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: dbus"
exec \
dbus-daemon --system --nofork
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: pulseaudio"
while :
do
if [[ ! $(/usr/bin/pulseaudio --check) ]]; then
/usr/bin/pulseaudio --system
fi
sleep 10
done

View File

@@ -1,4 +1,9 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: php pfm"
exec /usr/sbin/php-fpm* -F

View File

@@ -1,6 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: pulseaudio"
exec s6-setuidgid pi /usr/bin/pulseaudio \
--log-level=0 \
--log-target=stderr \
--exit-idle-time=-1 > /dev/null 2>&1

View File

@@ -1,8 +1,9 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: avahi daemon"
# Waiting for dbus
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
echo "Starting service: avahi daemon"
exec \
avahi-daemon --no-chroot

View File

@@ -1,8 +0,0 @@
#!/usr/bin/with-contenv bashio
echo "Starting service: caddy"
until [[ -e /var/run/dbus/system_bus_socket ]]; do
sleep 1s
done
exec \
s6-setuidgid "$USER" /usr/bin/caddy run --config /etc/caddy/Caddyfile

View File

@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bashio
# Dependencies
until [[ -e /var/run/dbus/system_bus_socket ]] && [[ -e /run/php/php*-fpm.sock ]]; do
sleep 1s
done
# Correct fpm.sock
sed -i "s|/run/php/php-fpm.sock|$(find /run/php -name *.sock)|g" /etc/caddy/Caddyfile
echo "Starting service: caddy"
exec \
s6-setuidgid "$USER" /usr/bin/caddy run --config /etc/caddy/Caddyfile

View File

@@ -6,6 +6,10 @@ set -e
# INITALISATION #
#################
# Starting dbus
echo "Starting service: dbus"
service dbus start
bashio::log.info "ALSA_CARD option is set to $(bashio::config "ALSA_CARD"). If the microphone doesn't work, please adapt it"
echo " "