From 12cc16459aa432bad72f05f5c6cfc049ee812ac4 Mon Sep 17 00:00:00 2001 From: "Josh.5" Date: Fri, 29 Sep 2023 23:39:26 +1300 Subject: [PATCH] Reduce some of the excessive sleep times for various things --- overlay/etc/cont-init.d/40-setup_locale.sh | 2 +- overlay/usr/bin/common-functions.sh | 1 - overlay/usr/bin/start-pulseaudio.sh | 1 - overlay/usr/bin/start-sunshine.sh | 8 ++++---- overlay/usr/bin/start-udev.sh | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/overlay/etc/cont-init.d/40-setup_locale.sh b/overlay/etc/cont-init.d/40-setup_locale.sh index 1322116..e35214b 100644 --- a/overlay/etc/cont-init.d/40-setup_locale.sh +++ b/overlay/etc/cont-init.d/40-setup_locale.sh @@ -9,7 +9,7 @@ if [ "${current_local}" != "${USER_LOCALES}" ]; then export LANGUAGE="${user_local}" export LANG="${user_local}" export LC_ALL="${user_local}" 2> /dev/null - sleep 2 + sleep 0.5 locale-gen update-locale LC_ALL="${user_local}" else diff --git a/overlay/usr/bin/common-functions.sh b/overlay/usr/bin/common-functions.sh index a0a1a51..d737e5d 100755 --- a/overlay/usr/bin/common-functions.sh +++ b/overlay/usr/bin/common-functions.sh @@ -36,7 +36,6 @@ wait_for_udev() { exit 11 fi done - sleep 5 } # Wait for dockerd to start diff --git a/overlay/usr/bin/start-pulseaudio.sh b/overlay/usr/bin/start-pulseaudio.sh index 65c4ee7..833fd32 100755 --- a/overlay/usr/bin/start-pulseaudio.sh +++ b/overlay/usr/bin/start-pulseaudio.sh @@ -19,7 +19,6 @@ trap _term SIGTERM SIGINT # EXECUTE PROCESS: echo "PULSEAUDIO: Starting pulseaudio service" -sleep 5 #/usr/bin/pulseaudio --disallow-module-loading --disallow-exit --exit-idle-time=-1 & /usr/bin/pulseaudio --exit-idle-time=-1 & pulseaudio_pid=$! diff --git a/overlay/usr/bin/start-sunshine.sh b/overlay/usr/bin/start-sunshine.sh index b20fbef..9563ec8 100755 --- a/overlay/usr/bin/start-sunshine.sh +++ b/overlay/usr/bin/start-sunshine.sh @@ -19,15 +19,15 @@ _term() { while kill -0 "$sunshine_pid"; do kill -TERM "$sunshine_pid" 2>/dev/null counter=$((counter + 1)) - [ "$counter" -gt 2 ] && break - sleep 2 + [ "$counter" -gt 8 ] && break + sleep 0.5 done counter=0 while kill -0 "$sunshine_pid"; do kill -KILL "$sunshine_pid" 2>/dev/null counter=$((counter + 1)) - [ "$counter" -gt 2 ] && break - sleep 1 + [ "$counter" -gt 4 ] && break + sleep 0.5 done } trap _term SIGTERM SIGINT diff --git a/overlay/usr/bin/start-udev.sh b/overlay/usr/bin/start-udev.sh index 1311f3c..73c8048 100755 --- a/overlay/usr/bin/start-udev.sh +++ b/overlay/usr/bin/start-udev.sh @@ -26,8 +26,8 @@ fi # Monitor kernel uevents udevadm monitor & monitor_pid=$! -# Wait for 10 seconds, then request device events from the kernel -sleep 10 +# Wait for 5 seconds, then request device events from the kernel +sleep 5 udevadm trigger # WAIT FOR CHILD PROCESS: