5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-01 20:41:45 +00:00
yggdrasil-go/contrib/systemd/yggdrasil.service
Arano-kai 045a24d74e Systemd: tun module and capabilities
- Enable (and limit to) capabilities that require to setup tun/tap interface.
- Ensure that tun module is active.
2019-10-02 00:36:33 +03:00

25 lines
652 B
Desktop File

[Unit]
Description=yggdrasil
Wants=network.target
After=network.target
[Service]
Group=yggdrasil
ProtectHome=true
ProtectSystem=true
SyslogIdentifier=yggdrasil
CapabilityBoundSet=CAP_NET_ADMIN
ExecStartPre=+/sbin/modprobe tun
ExecStartPre=/bin/sh -ec "if ! test -s /etc/yggdrasil.conf; \
then umask 077; \
yggdrasil -genconf > /etc/yggdrasil.conf; \
echo 'WARNING: A new /etc/yggdrasil.conf file has been generated.'; \
fi"
ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target