Update to how we choose if we are running udevd or dumb-udev

This fixes some issues I found with startup.
This commit is contained in:
Josh.5
2023-09-29 21:26:17 +13:00
parent 5a1d20daf5
commit 93718e1855
5 changed files with 39 additions and 76 deletions

View File

@@ -28,7 +28,7 @@ wait_for_x() {
wait_for_udev() {
MAX=10
CT=0
while [ ! -f /tmp/.started-udev ]; do
while [ ! -e /run/udev/control ]; do
sleep 1
CT=$(( CT + 1 ))
if [ "$CT" -ge "$MAX" ]; then
@@ -36,6 +36,7 @@ wait_for_udev() {
exit 11
fi
done
sleep 5
}
# Wait for dockerd to start

View File

@@ -17,18 +17,10 @@ _term() {
trap _term SIGTERM SIGINT
# CONFIGURE:
# Remove lockfile
rm -f /tmp/.started-udev
# EXECUTE PROCESS:
# Start dumb-udev
dumb-udev
dumb-udev &
dumb_udev_pid=$!
# Touch lockfile
sleep 1
touch /tmp/.started-udev
# WAIT FOR CHILD PROCESS:
wait "$dumb_udev_pid"

View File

@@ -16,12 +16,6 @@ _term() {
}
trap _term SIGTERM SIGINT
# CONFIGURE:
# Remove lockfile
rm -f /tmp/.started-udev
# EXECUTE PROCESS:
# Start udev
if command -v udevd &>/dev/null; then
@@ -32,9 +26,6 @@ fi
# Monitor kernel uevents
udevadm monitor &
monitor_pid=$!
# Touch lockfile
sleep 1
touch /tmp/.started-udev
# Wait for 10 seconds, then request device events from the kernel
sleep 10
udevadm trigger