etc/systemd/system: add cjdns/

This commit is contained in:
Aminda Suomalainen 2018-10-05 13:27:35 +03:00
parent 35f12ae35c
commit 06d5ff55d0
No known key found for this signature in database
GPG Key ID: 0C207F07B2F32B67
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1 @@
These files are copied from https://github.com/cjdelisle/cjdns/tree/master/contrib/systemd/ and in case of cjdns.service the pathes are adjusted to how I am likely to be run it.

View File

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

View File

@ -0,0 +1,20 @@
[Unit]
Description=cjdns: routing engine designed for security, scalability, speed and ease of use
Wants=network.target
After=network.target
[Service]
ProtectHome=true
ProtectSystem=true
SyslogIdentifier=cjdroute
ExecStartPre=/bin/sh -ec "if ! test -s /opt/cjdns/cjdroute.conf; \
then umask 077; \
/opt/cjdns/cjdroute --genconf > /opt/cjdns/cjdroute.conf; \
echo 'WARNING: A new /opt/cjdns/cjdroute.conf file has been generated.'; \
fi"
ExecStart=/bin/sh -c "exec /opt/cjdns/cjdroute --nobg < /opt/cjdns/cjdroute.conf"
Restart=always
[Install]
WantedBy=multi-user.target
Also=cjdns-resume.service