Add dumb-udev as a replacemet for

This commit is contained in:
Josh.5
2023-09-29 20:20:21 +13:00
parent 96d318ebd0
commit eeca08ce38
4 changed files with 61 additions and 0 deletions

View File

@@ -94,6 +94,14 @@ RUN \
python3-setuptools \ python3-setuptools \
python3-venv \ python3-venv \
&& \ && \
echo "**** Install dumb-udev ****" \
&& python3 -m pip install \
--break-system-packages \
--pre \
--upgrade \
--no-cache-dir \
git+https://github.com/Steam-Headless/dumb-udev.git@master
&& \
echo "**** Section cleanup ****" \ echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \ && apt-get clean autoclean -y \
&& apt-get autoremove -y \ && apt-get autoremove -y \

View File

@@ -49,6 +49,10 @@ else
# Disable supervisord script # Disable supervisord script
echo "**** Disable udev service ****"; echo "**** Disable udev service ****";
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/udev.ini sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/udev.ini
if [ ! -d /run/udev/data ]; then
echo "**** Enable dumb-udev service ****";
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/dumb-udev.ini
fi
fi fi

View File

@@ -0,0 +1,15 @@
[program:udev]
priority=10
autostart=false
autorestart=true
user=root
directory=/
command=start-dumb-udev.sh
stopsignal=INT
stdout_logfile=/var/log/supervisor/dumb-udev.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=7
stderr_logfile=/var/log/supervisor/dumb-udev.err.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=7

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
###
# File: start-dumb-udev.sh
# Project: bin
# File Created: Tuesday, 12th January 2022 8:46:47 am
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Friday, 14th January 2022 9:21:00 am
# Modified By: Josh.5 (jsunnex@gmail.com)
###
set -e
# CATCH TERM SIGNAL:
_term() {
kill -TERM "$dumb_udev_pid" 2>/dev/null
}
trap _term SIGTERM SIGINT
# CONFIGURE:
# Remove lockfile
rm -f /tmp/.started-udev
# EXECUTE PROCESS:
# Start dumb-udev
dumb-udev
dumb_udev_pid=$!
# Touch lockfile
sleep 1
touch /tmp/.started-udev
# WAIT FOR CHILD PROCESS:
wait "$dumb_udev_pid"