convert to s6 services

This commit is contained in:
Alexandre
2024-04-25 09:15:30 +02:00
parent fa7ce4a9d1
commit 4d7a5e274d
50 changed files with 121 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ ENV DEBIAN_FRONTEND="noninteractive" \
# hadolint ignore=DL3015
RUN \
# Install dependencies
# Install dependencies
apt-get update -y && apt-get install gcc python3-dev git jq sudo -y && \
\
# Ensure permissions
@@ -50,9 +50,11 @@ RUN \
sed -i '1a for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do sed -i "s|sudo ||" "$file"; done' /newinstaller.sh && \
sed -i '1a for file in $(grep -srl "my_dir" $HOME/BirdNET-Pi/scripts); do sed -i "s|\$my_dir|/config|" "$file"; done' /newinstaller.sh && \
sed -i '1a for file in $(grep -srl "install_services.sh" $HOME/BirdNET-Pi/scripts); do sed -i "/install_services.sh/c ./install_services.sh" "$file"; done' /newinstaller.sh && \
# Avoid systemctl
sed -i '/git clone/a sed -i "s|systemctl enable|#systemctl enable|g" $HOME/BirdNET-Pi/scripts/install_services.sh' /newinstaller.sh && \
\
/./newinstaller.sh && \
\
# Adapt for lsio
if [ -d /app ]; then rm -r /app; fi && \
@@ -72,7 +74,7 @@ RUN \
#USER root
#sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh"
# Correct script
#sed -i "s|== 0|== 7|g" /newinstaller.sh && \
#sed -i "s|== 0|== 7|g" /newinstaller.sh && \
#sed -i "s|sudo -n true|true|g" /newinstaller.sh && \
#sed -i "s|sudo -K|true|g" /newinstaller.sh && \
#for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do \sed -i "s|sudo ||" "$file"; done && \

View File

@@ -90,5 +90,5 @@
},
"slug": "birdnet-pi",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
"version": "0.7"
"version": "0.8"
}

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-custom_recording

View File

@@ -0,0 +1,5 @@
#!/bin/execlineb -P
with-contenv
s6-envdir /run/user/1000
s6-setuidgid ${USER}
/usr/local/bin/custom_recording.sh

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-avahi_alias

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(hostname -I |cut -d' ' -f1)"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_analysis

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
$PYTHON_VIRTUAL_ENV /usr/local/bin/birdnet_analysis.py

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_log

View File

@@ -0,0 +1,8 @@
#!/bin/execlineb -P
with-contenv
s6-envdir /run/user/1000
s6-setuidgid ${USER}
/usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh
#!/bin/sh
exec /usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 6 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_recording

View File

@@ -0,0 +1,5 @@
#!/bin/execlineb -P
with-contenv
s6-envdir /run/user/1000
s6-setuidgid ${USER}
/usr/local/bin/birdnet_recording.sh

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 5 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_stats

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
$HOME/BirdNET-Pi/birdnet/bin/streamlit run $HOME/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath "/stats"

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-caddy

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
/usr/local/bin/caddy run --config /etc/caddy/Caddyfile

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 120 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-chart_viewer

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
$PYTHON_VIRTUAL_ENV /usr/local/bin/daily_plot.py --daemon --sleep 2

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-getty

View File

@@ -0,0 +1,5 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
/sbin/agetty --autologin ${USER} --noclear %I \$TERM

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-livestream

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-envdir /run/user/1000
/usr/local/bin/livestream.sh

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 10 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-spectrogram_viewer

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-setuidgid ${USER}
/usr/local/bin/spectrogram.sh

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
if { sleep 3 }
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-web_terminal

View File

@@ -0,0 +1,4 @@
#!/bin/execlineb -P
with-contenv
s6-envdir /run/user/1000
/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" login

View File

@@ -0,0 +1 @@
longrun