# Continuum proxy as a systemd service - the template for a Proxy Box or a # Linux PC install. Adjust the paths; create the `continuum` user and put the # settings it reads (continuum.toml, or the signed bundle on a Box) under # /var/lib/continuum. # # Not exercised under a real systemd yet: this container's init is not # systemd, so only `systemd-analyze verify` has been run against it. [Unit] Description=Continuum proxy (printer gateway) Wants=network-online.target After=network-online.target [Service] Type=simple User=continuum # The proxy's relative defaults (./go2rtc.yaml, ./printers.toml, the go2rtc # pid file) resolve here, and StateDirectory creates it owned by the user. StateDirectory=continuum WorkingDirectory=/var/lib/continuum ExecStart=/usr/local/bin/continuum-proxy # Always, including a clean exit: installing a new config from a pendrive # deliberately ends the process and relies on this to start it on the new # settings (src/main.rs, config_import). Restart=always RestartSec=2 # Do not change this to `process` or `none`. go2rtc is the proxy's child, so # it lives in this unit's cgroup, and this is what makes systemd kill it # whenever the proxy goes - including SIGKILL and the OOM killer, which give # the proxy no chance to stop it itself. It is systemd's default; it is # written out so nobody weakens it by accident. An orphaned go2rtc keeps # :1984/:8555 bound and a printer's access code in memory. KillMode=control-group TimeoutStopSec=10 [Install] WantedBy=multi-user.target