5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-12 23:20:28 +00:00

Merge pull request #9 from neilalexander/master

Add systemd service files
This commit is contained in:
Arceliar 2018-01-29 12:36:01 -06:00 committed by GitHub
commit fe8a78f966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=Restart yggdrasil on resume from sleep
After=sleep.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart yggdrasil
[Install]
WantedBy=sleep.target

View File

@ -0,0 +1,20 @@
[Unit]
Description=yggdrasil
Wants=network.target
After=network.target
[Service]
ProtectHome=true
ProtectSystem=true
SyslogIdentifier=yggdrasil
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=/bin/sh -c "exec yggdrasil -useconf < /etc/yggdrasil.conf"
Restart=always
[Install]
WantedBy=multi-user.target
Also=yggdrasil-resume.service