diff --git a/docs/Running-this-software.md b/docs/Running-this-software.md index be2de09..ba7bd81 100644 --- a/docs/Running-this-software.md +++ b/docs/Running-this-software.md @@ -456,6 +456,34 @@ You should now have: with an example config override file if you didn't already have a `config.json` here. +### Using systemd to run the live service +`systemd/` contains two systemd unit files to enable starting the services +via system, including at boot time. + +1. `systemd/eddn@.service` - a systemd template unit file that can be used + to start/stop any of the EDDN services **in the live environment**. + You would invoke it like: + + `systemctl start eddn@eddn-gateway.service` + +1. `systemd/eddn.target` - a system target until file which will start all + of: + + ``` + eddn@eddn-relay.service + eddn@eddn-monitor.service + eddn@eddn-gateway.service + ``` +To get them working: + + 1. copy both files into `/etc/systemd/system/`. + + 1. Enable the target and services: + 1. `systemctl enable eddn.target` + 1. `systemctl enable eddn@eddn-gateway.service` + 1. `systemctl enable eddn@eddn-monitor.service` + 1. `systemctl enable eddn@eddn-relay.service` + ### Post-installation steps If you're not using the `live` environment then there are some edits you need to make. diff --git a/systemd/eddn.target b/systemd/eddn.target index 848cf46..e48c56e 100644 --- a/systemd/eddn.target +++ b/systemd/eddn.target @@ -1,6 +1,6 @@ [Unit] Description=EDDN Services -Requires=eddn@eddn-relay.service eddn@eddn-monitor.service eddn@eddn-gateway.service +Requires=eddn@relay.service eddn@monitor.service eddn@gateway.service [Install] WantedBy=multi-user.target diff --git a/systemd/eddn@.service b/systemd/eddn@.service index 9ef01de..1642d45 100644 --- a/systemd/eddn@.service +++ b/systemd/eddn@.service @@ -7,7 +7,7 @@ [Unit] Description=EDDN Service %i -AssertPathExists=/home/eddn/eddn/python-venv/bin/%i +AssertPathExists=/home/eddn/live/python-venv/bin/eddn-%i PartOf=eddn.service ReloadPropagatedFrom=eddn.service Before=eddn.service @@ -18,7 +18,7 @@ After=network.target Type=simple User=eddn Group=eddn -ExecStart=/home/eddn/.local/bin/start-eddn-service %i +ExecStart=/home/eddn/.local/bin/start-eddn-live-service live %i TimeoutStartSec=10s TimeoutStopSec=10s SyslogIdentifier=eddn@%i