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:
parent
63e056eb0a
commit
4c1ac06cdb
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue