From d36ab05bf113b9c39648a9b04bc766e5c2b9a2ad Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 18 Jan 2023 20:50:51 -0300 Subject: [PATCH] Do not wait forever for services to exit (#5149) * Fix frigate service restarting inside devcontainer * Add timeouts to services exit process So s6 won't wait forever. --- docker/fake_frigate_run | 7 ++++++- docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/timeout-kill | 1 + docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/timeout-kill | 1 + docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/timeout-kill | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/timeout-kill create mode 100644 docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/timeout-kill create mode 100644 docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/timeout-kill diff --git a/docker/fake_frigate_run b/docker/fake_frigate_run index a4415b616..7344f625b 100755 --- a/docker/fake_frigate_run +++ b/docker/fake_frigate_run @@ -2,7 +2,12 @@ # shellcheck shell=bash # Start the fake Frigate service +set -o errexit -o nounset -o pipefail + +# Tell S6-Overlay not to restart this service +s6-svc -O . + while true; do - echo "The fake Frigate service is running..." + echo "[INFO] The fake Frigate service is running..." sleep 5s done diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/timeout-kill b/docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/timeout-kill new file mode 100644 index 000000000..6f4f41844 --- /dev/null +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/frigate/timeout-kill @@ -0,0 +1 @@ +120000 diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/timeout-kill b/docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/timeout-kill new file mode 100644 index 000000000..3a05c8b3e --- /dev/null +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/timeout-kill @@ -0,0 +1 @@ +30000 diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/timeout-kill b/docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/timeout-kill new file mode 100644 index 000000000..3a05c8b3e --- /dev/null +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/timeout-kill @@ -0,0 +1 @@ +30000