diff --git a/scripts/run_client.py b/scripts/run_client.py index 7cca348..05833e8 100644 --- a/scripts/run_client.py +++ b/scripts/run_client.py @@ -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 aren’t 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"