From 5728e8769aacafe3a3f8811c35f113ef3ce92c9f Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 1 May 2026 22:00:32 +0200 Subject: [PATCH] fix: simplify reboot to direct SSH invocation --- STATE.md | 4 ++-- bin/netupgrade | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/STATE.md b/STATE.md index 5080e01..50100c7 100644 --- a/STATE.md +++ b/STATE.md @@ -48,7 +48,7 @@ - `SSH_USER` is configurable and defaults to `root` - `NODES` parsing was hardened to preserve spaces in action values such as `cmd:...` - `cmd:<...>` is executed through a remote shell to support shell operators, but remains intentionally powerful and unsafe -- `reboot` uses a detached remote command to reduce false failures caused by expected SSH disconnects +- `reboot` now uses a direct SSH `reboot` invocation to keep the remote reboot path simple and predictable - `docker-stacks` runs through a remote shell script sent over SSH stdin to improve path handling and quoting - Startup dependency checks cover required local commands, including `mv` for log-summary rewriting @@ -67,7 +67,7 @@ - Log viewer fallback was made more flexible - `NODES` parsing was hardened to preserve spaces in action values - SSH execution was centralized and made configurable through `SSH_USER` -- Remote command construction was improved for `pacman`, `docker-stacks`, and `reboot` +- Remote command construction was improved for `pacman` and `docker-stacks`; `reboot` was simplified to a direct SSH command - Log summary generation was rewritten to avoid `sed -i` interpolation and now replaces the log atomically - `apk` and `apt` cleanup behavior was corrected to better match real package-manager semantics - The sample configuration in `config/netupgrade/hypervisor-01.cfg` now keeps the alternate `docker-01` reboot example commented out rather than active by default diff --git a/bin/netupgrade b/bin/netupgrade index 1053fc1..7696a9a 100755 --- a/bin/netupgrade +++ b/bin/netupgrade @@ -201,11 +201,9 @@ runCmd() { # $1=host $2=name $3=cmd case ${CMD} in reboot) - echo "reboot (detached)" | tee -a "${LOGFILENAME}" - if ! runSSH "${HOST}" sh -c 'nohup sh -c "reboot || /sbin/reboot || shutdown -r now" >/dev/null 2>&1