This commit is contained in:
2026-01-23 03:02:21 -08:00
parent 6a2e7b5741
commit 1e306d7d78

View File

@@ -373,6 +373,20 @@ def install_service_systemd(
workspace_root=workspace_root,
)
if os.name != "nt" and hasattr(os, "geteuid") and os.geteuid() == 0:
print(
"Running as root; systemd user services arent available. Falling back to cron @reboot."
)
return install_service_cron(
service_name,
repo_root,
venv_py,
headless=headless,
detached=detached,
pull=pull,
workspace_root=workspace_root,
)
unit_dir = Path.home() / ".config" / "systemd" / "user"
unit_dir.mkdir(parents=True, exist_ok=True)
unit_file = unit_dir / f"{service_name}.service"