34 lines
1.7 KiB
Desktop File
34 lines
1.7 KiB
Desktop File
[Unit]
|
|
# Canonical, version-controlled copy of the unit for the cc-ci-orchestrator VM.
|
|
# Install: sudo install -m0644 cc-ci-plan/systemd/cc-ci-loops.service /etc/systemd/system/ \
|
|
# && sudo systemctl daemon-reload && sudo systemctl enable cc-ci-loops.service
|
|
# NOTE: the VM's actual reboot-resilience service is declared in nix/configuration.nix (systemd.services.cc-ci-loops).
|
|
# This file is the repo reference copy — keep both in sync when making changes.
|
|
# Brings the WHOLE rig back after a reboot of the cc-ci-orchestrator VM: loops + watchdog (launch.sh) AND
|
|
# the orchestrator supervisory session (launch-orchestrator.sh), plus a reboot record (reboot-log.sh).
|
|
Description=cc-ci autonomous loops + watchdog + orchestrator (reboot-resilient)
|
|
Documentation=file:///srv/cc-ci/cc-ci-plan/plan.md
|
|
After=network-online.target tailscaled.service
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
User=loops
|
|
Group=loops
|
|
Environment=HOME=/home/loops
|
|
Environment=PATH=/home/loops/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
|
# RESUME_PHASE=1 so a reboot resumes the SAVED phase (e.g. phase 2), never restarts from phase 0/1c.
|
|
Environment=RESUME_PHASE=1
|
|
# 1) record the reboot (boot_id-gated); 2) start loops + watchdog; 3) resume the orchestrator session.
|
|
ExecStartPre=/srv/cc-ci/cc-ci-plan/reboot-log.sh
|
|
ExecStart=/srv/cc-ci/cc-ci-plan/launch.sh start
|
|
ExecStartPost=/srv/cc-ci/cc-ci-plan/launch-orchestrator.sh start
|
|
# Stop only the loops + watchdog. The orchestrator session is intentionally LEFT running on a manual
|
|
# `systemctl stop` (stopping the loops shouldn't kill your steering session; it resumes from disk).
|
|
ExecStop=/srv/cc-ci/cc-ci-plan/launch.sh stop
|
|
TimeoutStartSec=180
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|