diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run index 481f2ea447..5c14ae564a 100755 --- a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run @@ -14,8 +14,7 @@ fi # Tell S6-Overlay not to restart this service s6-svc -O . -# This runs as root before any /config path enters the environment; -I skips -# the user site-packages under $HOME +# Runs as root with root's HOME and LD_LIBRARY_PATH; -I skips user site-packages function set_libva_version() { local ffmpeg_path ffmpeg_path=$(python3 -I /usr/local/ffmpeg/get_ffmpeg_path.py) @@ -45,7 +44,7 @@ run_as+=(env # opt out of openvino telemetry; the marker lands under the service's HOME if [ -e /usr/local/bin/opt_in_out ]; then - "${run_as[@]}" /usr/local/bin/opt_in_out --opt_out > /dev/null 2>&1 + "${run_as[@]}" /usr/local/bin/opt_in_out --opt_out > /dev/null 2>&1 || true fi echo "[INFO] Starting Frigate..." diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run index 152be1fc11..69ef70ae1d 100755 --- a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run @@ -66,23 +66,18 @@ function set_libva_version() { set_libva_version -if [[ -e "/dev/shm/go2rtc.yaml" || -L "/dev/shm/go2rtc.yaml" ]]; then - echo "[INFO] Removing stale config from last run..." - rm /dev/shm/go2rtc.yaml +# create_config.py creates the file exclusively and fails if anything +# reappears at this path +rm -f /dev/shm/go2rtc.yaml + +echo "[INFO] Preparing new go2rtc config..." + +if [[ -n "${SUPERVISOR_TOKEN:-}" ]]; then + # Running as a Home Assistant Add-on, infer the IP address and port + get_ip_and_port_from_supervisor fi -if [[ ! -f "/dev/shm/go2rtc.yaml" ]]; then - echo "[INFO] Preparing new go2rtc config..." - - if [[ -n "${SUPERVISOR_TOKEN:-}" ]]; then - # Running as a Home Assistant Add-on, infer the IP address and port - get_ip_and_port_from_supervisor - fi - - python3 -I /usr/local/go2rtc/create_config.py -else - echo "[WARNING] Unable to remove existing go2rtc config. Changes made to your frigate config file may not be recognized. Please remove the /dev/shm/go2rtc.yaml from your docker host manually." -fi +python3 -I /usr/local/go2rtc/create_config.py # HomeKit persistence. The helper is symlink-safe; hand off to go2rtc only when dropping. readonly homekit_config_path="/config/go2rtc_homekit.yml"