Compare commits

...
Author SHA1 Message Date
CanbiZ (MickLesk) 3e077a2c4a Clean up comments in hermesagent.sh
Removed comments regarding hermes update and matching patterns.
2026-10-11 08:54:11 +02:00
MickLesk 1624512db4 hermesagent: match the relaunched root gateway regardless of interpreter
Upstream now starts the gateway through its bundled python via runpy, so
the venv-path pattern from #17126 matched nothing and the root gateway
survived; its writes then raced chown -R and aborted the update.
2026-10-11 08:52:38 +02:00
+9 -3
View File
@@ -51,8 +51,7 @@ function update_script() {
set -a; source /etc/default/hermes; set +a
/home/hermes/.local/bin/hermes update --yes
'
# See https://github.com/community-scripts/ProxmoxVE/issues/17123
mapfile -t root_gateway_pids < <(ps -eo user=,pid=,args= | awk '$1 == "root" && $0 ~ /\/home\/hermes\/\.hermes\/hermes-agent\/venv\/bin\/python -m hermes_cli\.main gateway run --replace$/ { print $2 }')
mapfile -t root_gateway_pids < <(ps -eo user=,pid=,args= | awk '$1 == "root" && /\/home\/hermes\/\.hermes\// && /hermes_cli[.]main/ && / gateway run --replace$/ { print $2 }')
if ((${#root_gateway_pids[@]})); then
kill -TERM "${root_gateway_pids[@]}"
for pid in "${root_gateway_pids[@]}"; do
@@ -61,7 +60,14 @@ function update_script() {
done
done
fi
chown -R hermes:hermes /home/hermes
if ps -eo user=,args= | awk '$1 == "root" && /\/home\/hermes\/\.hermes\// { found = 1 } END { exit !found }'; then
msg_warn "A root-owned Hermes process is still running; it may keep writing root-owned files"
fi
# A writer racing chown makes files vanish between readdir and chown; one retry covers it.
if ! chown -R hermes:hermes /home/hermes 2>/dev/null; then
sleep 1
chown -R hermes:hermes /home/hermes || msg_warn "Could not take ownership of everything under /home/hermes"
fi
msg_ok "Updated Hermes Agent"
msg_info "Starting Services"