systemd: Updates for it to work with current paradigm

This commit is contained in:
Athanasius 2021-07-06 13:29:29 +00:00
parent adc03e35c6
commit e3053dc0b6
3 changed files with 31 additions and 3 deletions

View File

@ -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.

View File

@ -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

View File

@ -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