Add systemd service files.

This commit is contained in:
Naoki Kosaka 2021-06-21 09:18:24 +09:00
parent 846b600d95
commit 4a9f05626b
2 changed files with 51 additions and 0 deletions

26
misc/dist/init/relay-api.service vendored Normal file
View File

@ -0,0 +1,26 @@
# relay-api.service
#
# For using YUKIMOCHI Activity-Relay.
#
# See https://github.com/yukimochi/Activity-Relay/wiki for instructions.
[Unit]
Description=YUKIMOCHI Activity-Relay API Server
Documentation=https://github.com/yukimochi/Activity-Relay/wiki
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=simple
User=relay
Group=relay
ExecStart=/usr/bin/relay --config /var/lib/relay/config.yaml server
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target

25
misc/dist/init/relay-worker.service vendored Normal file
View File

@ -0,0 +1,25 @@
# relay-worker.service
#
# For using YUKIMOCHI Activity-Relay.
#
# See https://github.com/yukimochi/Activity-Relay/wiki for instructions.
[Unit]
Description=YUKIMOCHI Activity-Relay Job Worker
Documentation=https://github.com/yukimochi/Activity-Relay/wiki
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=simple
User=relay
Group=relay
ExecStart=/usr/bin/relay --config /var/lib/relay/config.yaml worker
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
[Install]
WantedBy=multi-user.target