h
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user