# Canonical example unit for BaseRunnerMulti.py - see docs/BaseRunnerMulti.md's # "Deployment" section for the copy/daemon-reload/enable/start sequence. # Adjust paths if this host's checkout doesn't live at /usr/local/basestation3. [Unit] Description=Consolidated multi-site glider account runner After=network.target baserunnerprivexec.service # Wants=, not Requires=: still pulls baserunnerprivexec.service in and # orders this unit's start after it (see After= above), but - unlike # Requires= - does NOT stop this unit whenever baserunnerprivexec.service # is stopped or restarted (e.g. to pick up a sites.yaml/cgroup edit, or a # unit-file change - see "Installing the units" below). This unit's own # dispatch-failure requeue (Dispatcher._dispatch_one_queued) already # absorbs the helper being briefly unreachable during that restart, so # there's nothing to gain from also taking this unit down - Requires= # previously did exactly that, silently, since Requires= propagates a # stop to units that declare it, not only a start. Wants=baserunnerprivexec.service [Service] User=baserunner Group=baserunner # baserunner has no home directory (--no-create-home), so matplotlib's # default $HOME/.config/matplotlib cache dir isn't writable; it falls # back to a throwaway /tmp dir with a startup warning if left unset. CacheDirectory=baserunner Environment=MPLCONFIGDIR=/var/cache/baserunner ExecStart=/opt/basestation/bin/python /usr/local/basestation3/BaseRunnerMulti.py \ --sites_config /usr/local/basestation3/etc/sites.yaml \ --priv_exec_socket /run/baserunner/priv_exec.sock \ --cgroup_root /sys/fs/cgroup/baserunner.slice \ --base_log /var/log/baserunner/baserunnermulti.log # --job_completions_log /var/log/baserunner/job_completions.jsonl # Read-only: BaseRunnerMulti.py only reads memory.current/memory.peak # stat files under this path for per-job memory tracking, it never # writes to cgroupfs. Must match baserunnerprivexec.service's own # --cgroup_root exactly, or memory reporting silently reads nothing # (fail-open, not fatal) - see "Per-site memory limits" in # docs/BaseRunnerMulti.md. # --job_completions_log (commented out above - opt in by uncommenting # and pointing local/collect_cgroup_stats.py's own --job_completions_log # at the same path) is a per-job record that never misses a short-lived # job, unlike the periodic cgroup sampler - see "Per-site memory limits" # in docs/BaseRunnerMulti.md for why that gap exists. # Creates /var/log/baserunner/ owned baserunner:baserunner (mode 0750) on # every start, recreating it if it's ever missing - no manual mkdir/chown # of the log directory needed. Requires systemd >= 235. LogsDirectory=baserunner WatchdogSec=30 Restart=always Type=notify [Install] WantedBy=multi-user.target