mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat(gateway): scope systemd service name to HERMES_HOME
Multiple Hermes installations on the same machine now get unique systemd service names: - Default ~/.hermes → hermes-gateway (backward compatible) - Custom HERMES_HOME → hermes-gateway-<8-char-hash> Changes: - Add get_service_name() in hermes_cli/gateway.py that derives a deterministic service name from HERMES_HOME via SHA256 - Replace all hardcoded 'hermes-gateway' systemd references with get_service_name() across gateway.py, main.py, status.py, uninstall.py - Add HERMES_HOME env var to both user and system systemd unit templates so the gateway process uses the correct installation - Update tests to use get_service_name() in assertions
This commit is contained in:
parent
e7d3f1f3ba
commit
30da22e1c1
7 changed files with 68 additions and 30 deletions
|
|
@ -2306,14 +2306,16 @@ def cmd_update(args):
|
|||
# installation's gateway — safe with multiple installations.
|
||||
try:
|
||||
from gateway.status import get_running_pid, remove_pid_file
|
||||
from hermes_cli.gateway import get_service_name
|
||||
import signal as _signal
|
||||
|
||||
_gw_service_name = get_service_name()
|
||||
existing_pid = get_running_pid()
|
||||
has_systemd_service = False
|
||||
|
||||
try:
|
||||
check = subprocess.run(
|
||||
["systemctl", "--user", "is-active", "hermes-gateway"],
|
||||
["systemctl", "--user", "is-active", _gw_service_name],
|
||||
capture_output=True, text=True, timeout=5,
|
||||
)
|
||||
has_systemd_service = check.stdout.strip() == "active"
|
||||
|
|
@ -2340,7 +2342,7 @@ def cmd_update(args):
|
|||
_time.sleep(1) # Brief pause for port/socket release
|
||||
print("→ Restarting gateway service...")
|
||||
restart = subprocess.run(
|
||||
["systemctl", "--user", "restart", "hermes-gateway"],
|
||||
["systemctl", "--user", "restart", _gw_service_name],
|
||||
capture_output=True, text=True, timeout=15,
|
||||
)
|
||||
if restart.returncode == 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue