mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
fix(gateway): handle Linux setups without systemctl
This commit is contained in:
parent
4eecaf06e4
commit
e89b9d9732
4 changed files with 78 additions and 12 deletions
|
|
@ -355,6 +355,8 @@ def _wsl_systemd_operational() -> bool:
|
|||
def supports_systemd_services() -> bool:
|
||||
if not is_linux() or is_termux():
|
||||
return False
|
||||
if shutil.which("systemctl") is None:
|
||||
return False
|
||||
if is_wsl():
|
||||
return _wsl_systemd_operational()
|
||||
return True
|
||||
|
|
@ -2135,7 +2137,7 @@ def _is_service_running() -> bool:
|
|||
)
|
||||
if result.stdout.strip() == "active":
|
||||
return True
|
||||
except subprocess.TimeoutExpired:
|
||||
except (FileNotFoundError, subprocess.TimeoutExpired):
|
||||
pass
|
||||
|
||||
if system_unit_exists:
|
||||
|
|
@ -2146,7 +2148,7 @@ def _is_service_running() -> bool:
|
|||
)
|
||||
if result.stdout.strip() == "active":
|
||||
return True
|
||||
except subprocess.TimeoutExpired:
|
||||
except (FileNotFoundError, subprocess.TimeoutExpired):
|
||||
pass
|
||||
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue