Fix/systemd restart on failure - #35899
Closed
wildekek wants to merge 3 commits into
Closed
Conversation
The v0.15.0 PyPI wheel shipped every plugin's Python code but none of its plugin.yaml manifests, so plugin discovery (hermes_cli/plugins.py) found zero plugins and ALL gateway platforms failed with "No adapter available for <platform>" (discord, slack, mattermost, ...). Same gap also dropped the web-search provider manifests (NousResearch#28149). Declare manifest coverage in both packaging channels: - wheel: [tool.setuptools.package-data] plugins += **/plugin.yaml, **/plugin.yml - sdist: MANIFEST.in recursive-include plugins plugin.yaml plugin.yml (Homebrew and other downstream packagers build from the sdist) Verified by building the wheel before/after: plugin.yaml count went 0 -> 69, discord's manifest now ships. Adds a regression test asserting both channels cover manifests. Fixes NousResearch#34034 Co-authored-by: outsourc-e <201563152+outsourc-e@users.noreply.github.com> Co-authored-by: Dhruvil Parikh <41384593+dparikh79@users.noreply.github.com> Co-authored-by: ousiaresearch <261687298+ousiaresearch@users.noreply.github.com> Co-authored-by: libre-7 <6366424+libre-7@users.noreply.github.com>
Restart=always causes systemd to respawn the gateway service immediately after any exit, including during system reboot/shutdown when systemd sends SIGTERM. This races with the shutdown sequence. Restart=on-failure still restarts on crashes (non-zero exit, signal termination, timeout) and keeps the RestartForceExitStatus=75 mechanism for deliberate graceful restarts via SIGUSR1. But it won't respawn after a clean shutdown, so the system can reboot without fighting the service manager.
Collaborator
|
The |
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.
What does this PR do?
Changes Restart=always to Restart=on-failure in the systemd unit templates generated by generate_systemd_unit().
The problem: Restart=always causes systemd to respawn the gateway service immediately after any exit, including the clean SIGTERM exit during system reboot/shutdown. When multiple gateway services are installed (e.g., per-profile gateways), they restart in a loop as fast as systemd can kill them, blocking the shutdown sequence and preventing the system from rebooting.
Why this approach: Restart=on-failure preserves all existing restart behavior for actual failures — crashes (non-zero exit), signal termination, and the existing RestartForceExitStatus=75 mechanism for deliberate graceful restarts via SIGUSR1 — but won't respawn after a clean exit (exit code 0 from SIGTERM during shutdown), so the system can reboot without fighting the service manager.
Related Issue
Fixes # — no existing issue filed. Discovered and fixed while debugging a Debian system with 3 gateway services that couldn't reboot.
Changes Made
How to Test