fix(gateway): avoid systemctl crashes in Linux environments without systemd - #7437
Closed
dlkakbs wants to merge 1 commit into
Closed
fix(gateway): avoid systemctl crashes in Linux environments without systemd#7437dlkakbs wants to merge 1 commit into
dlkakbs wants to merge 1 commit into
Conversation
dlkakbs
force-pushed
the
fix/gateway-no-systemctl
branch
from
April 10, 2026 23:09
63043fa to
ff3e438
Compare
Contributor
|
Closing as duplicate — this issue is fixed in #8614 (salvaged from @alt-glitch's comprehensive #8573). Thanks for the contribution! |
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
#7420
Fix gateway setup on Linux environments where
systemctlis unavailable, such as Docker containers without systemd.Previously, Hermes treated any non-Termux Linux environment as systemd-capable. During
hermes setup, that led to directsystemctlcalls in gateway service checks, which crashed with:FileNotFoundError: [Errno 2] No such file or directory: 'systemctl'What changed
supports_systemd_services()so it only returns true when:systemctlis actually available onPATH_is_service_running()to safely handle missingsystemctlsetup_gateway()to only offer systemd service flows when systemd is actually supportedWhy
Some Linux environments, especially Docker images, do not include
systemctlor run without systemd as PID 1.Hermes was previously using a Linux-only check as a proxy for systemd availability, which caused setup to attempt service-manager operations that the environment could not support.
Result
In Linux environments without
systemctl:hermes setupno longer crasheshermes gatewayTests
Added regression coverage for:
systemctlbinary_is_service_running()whensystemctlis missingsetup_gateway()fallback behavior when messaging is configured but no service manager is availableVerified locally with:
python3 -m pytest tests/hermes_cli/test_gateway_service.py -qpython3 -m pytest tests/hermes_cli/test_setup.py -q