mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Preserve original service files for other packages
This commit is contained in:
parent
65b37273e2
commit
f5dec81116
5 changed files with 50 additions and 15 deletions
|
@ -130,7 +130,8 @@ EOF
|
||||||
|
|
||||||
cp yggdrasil /tmp/$PKGNAME/usr/bin/
|
cp yggdrasil /tmp/$PKGNAME/usr/bin/
|
||||||
cp yggdrasilctl /tmp/$PKGNAME/usr/bin/
|
cp yggdrasilctl /tmp/$PKGNAME/usr/bin/
|
||||||
cp contrib/systemd/*.service /tmp/$PKGNAME/usr/lib/systemd/system/
|
cp contrib/systemd/yggdrasil-default-config.service.debian /tmp/$PKGNAME/usr/lib/systemd/system/yggdrasil-default-config.service
|
||||||
|
cp contrib/systemd/yggdrasil.service.debian /tmp/$PKGNAME/usr/lib/systemd/system/yggdrasil.service
|
||||||
|
|
||||||
tar --no-xattrs -czvf /tmp/$PKGNAME/data.tar.gz -C /tmp/$PKGNAME/ \
|
tar --no-xattrs -czvf /tmp/$PKGNAME/data.tar.gz -C /tmp/$PKGNAME/ \
|
||||||
usr/bin/yggdrasil usr/bin/yggdrasilctl \
|
usr/bin/yggdrasil usr/bin/yggdrasilctl \
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Yggdrasil default config generator
|
Description=yggdrasil default config generator
|
||||||
ConditionPathExists=|!/etc/yggdrasil/yggdrasil.conf
|
ConditionPathExists=|!/etc/yggdrasil.conf
|
||||||
ConditionFileNotEmpty=|!/etc/yggdrasil/yggdrasil.conf
|
ConditionFileNotEmpty=|!/etc/yggdrasil.conf
|
||||||
Wants=local-fs.target
|
Wants=local-fs.target
|
||||||
After=local-fs.target
|
After=local-fs.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
Group=yggdrasil
|
Group=yggdrasil
|
||||||
ExecStartPre=/usr/bin/mkdir -p /etc/yggdrasil
|
StandardOutput=file:/etc/yggdrasil.conf
|
||||||
ExecStart=/usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf
|
ExecStart=/usr/bin/yggdrasil -genconf
|
||||||
ExecStartPost=/usr/bin/chmod -R 0640 /etc/yggdrasil
|
ExecStartPost=/usr/bin/chmod 0640 /etc/yggdrasil.conf
|
||||||
|
|
13
contrib/systemd/yggdrasil-default-config.service.debian
Normal file
13
contrib/systemd/yggdrasil-default-config.service.debian
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Yggdrasil default config generator
|
||||||
|
ConditionPathExists=|!/etc/yggdrasil/yggdrasil.conf
|
||||||
|
ConditionFileNotEmpty=|!/etc/yggdrasil/yggdrasil.conf
|
||||||
|
Wants=local-fs.target
|
||||||
|
After=local-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
Group=yggdrasil
|
||||||
|
ExecStartPre=/usr/bin/mkdir -p /etc/yggdrasil
|
||||||
|
ExecStart=/usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf
|
||||||
|
ExecStartPost=/usr/bin/chmod -R 0640 /etc/yggdrasil
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Yggdrasil Network
|
Description=yggdrasil
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
Wants=yggdrasil-default-config.service
|
Wants=yggdrasil-default-config.service
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
@ -8,18 +8,14 @@ After=yggdrasil-default-config.service
|
||||||
[Service]
|
[Service]
|
||||||
Group=yggdrasil
|
Group=yggdrasil
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
ProtectSystem=strict
|
ProtectSystem=true
|
||||||
NoNewPrivileges=true
|
|
||||||
RuntimeDirectory=yggdrasil
|
|
||||||
ReadWritePaths=/var/run/yggdrasil/ /run/yggdrasil/
|
|
||||||
SyslogIdentifier=yggdrasil
|
SyslogIdentifier=yggdrasil
|
||||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||||
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
|
||||||
ExecStartPre=+-/sbin/modprobe tun
|
ExecStartPre=+-/sbin/modprobe tun
|
||||||
ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil/yggdrasil.conf
|
ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil.conf
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
Restart=always
|
Restart=always
|
||||||
TimeoutStopSec=5
|
TimeoutStopSec=5
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
25
contrib/systemd/yggdrasil.service.debian
Normal file
25
contrib/systemd/yggdrasil.service.debian
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Yggdrasil Network
|
||||||
|
Wants=network-online.target
|
||||||
|
Wants=yggdrasil-default-config.service
|
||||||
|
After=network-online.target
|
||||||
|
After=yggdrasil-default-config.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Group=yggdrasil
|
||||||
|
ProtectHome=true
|
||||||
|
ProtectSystem=strict
|
||||||
|
NoNewPrivileges=true
|
||||||
|
RuntimeDirectory=yggdrasil
|
||||||
|
ReadWritePaths=/var/run/yggdrasil/ /run/yggdrasil/
|
||||||
|
SyslogIdentifier=yggdrasil
|
||||||
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||||
|
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
|
||||||
|
ExecStartPre=+-/sbin/modprobe tun
|
||||||
|
ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil/yggdrasil.conf
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=always
|
||||||
|
TimeoutStopSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue