fix(update): restart systemd-supervised remote backends after killing stale processes - #69029
Closed
webtecnica wants to merge 2 commits into
Closed
fix(update): restart systemd-supervised remote backends after killing stale processes#69029webtecnica wants to merge 2 commits into
webtecnica wants to merge 2 commits into
Conversation
Previously _count_skills() only counted SKILL.md files inside the profile's own skills/ directory, making the WebUI profile card show a misleading low count (e.g. 0 for 'default', 30 for 'webtecnica') even though the profile loaded 150+ skills from global + external dirs. Now it scans three sources: 1. Profile-specific skills/ dir (as before) 2. Global ~/.hermes/skills/ dir (via get_default_hermes_root) 3. External dirs from skills.external_dirs config Deduplication by skill name (from YAML frontmatter) prevents double- counting when the same skill exists in both global and profile dirs, matching how scan_skill_commands() loads skills at runtime. The cache is updated to key on all scanned directories and track their combined mtime signatures.
Collaborator
Related: #39166 and #68934 cover the same update/systemd-stop family. This patch restarts the killed PID's detected service after termination, while #39166 restarts a known dashboard unit before raw termination; a maintainer should choose the intended lifecycle scope and mechanism. |
13 tasks
Contributor
|
Merged via PR #72192 — your commit was cherry-picked onto current main with your authorship preserved in git history (d1f3760). The unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
hermes updateruns on a remote backend, it killshermes serve/hermes dashboardprocesses with SIGTERM. Systemd treats that as a clean stop andRestart=on-failuredoes not restart the service — so the Desktop never reconnects.Changes
hermes_cli/main.py— Added four helper functions and modified_kill_stale_dashboard_processesto restart systemd-supervised processes after killing them:_get_systemd_service_for_pid(pid)— reads/proc/<pid>/cgroupand extracts the systemd service unit name_get_pid_cgroup_path(pid)— returns the raw cgroup path string_extract_scope_from_cgroup(path)— determines user vs system scope from the cgroup path_try_restart_systemd_service(name, cgroup_path)— runssystemctl restart(orsystemctl --user restart)_kill_stale_dashboard_processes— snapshots cgroup info before killing each PID (cgroup metadata vanishes with the process), then restarts any systemd service units whose PIDs were killedCloses #68934
Testing
_kill_stale_dashboard_processes— integration-level function