fix: stop existing pulse-sensor-proxy service before binary update

When installing temperature monitoring for a new container, stop any
existing pulse-sensor-proxy service before trying to overwrite the
binary. This prevents 'Text file busy' errors when the binary is
currently running.

Fixes the error that occurred when installing container 103 while
container 107's proxy was still running.
This commit is contained in:
rcourtman 2025-10-21 09:39:30 +00:00
parent 63e056eb0a
commit 4c1ac06cdb

View file

@ -1284,6 +1284,13 @@ create_lxc_container() {
if [[ -f "$proxy_script" ]]; then
chmod +x "$proxy_script"
# Stop existing pulse-sensor-proxy service if running to allow binary update
if systemctl is-active --quiet pulse-sensor-proxy 2>/dev/null; then
print_info "Stopping existing pulse-sensor-proxy service to update binary..."
systemctl stop pulse-sensor-proxy 2>/dev/null || true
sleep 1
fi
# If building from source, copy the binary from the LXC instead of downloading
local proxy_install_args=(--ctid "$CTID" --skip-restart)
if [[ "$BUILD_FROM_SOURCE" == "true" ]]; then