mirror of
https://github.com/jwhited/wgsd.git
synced 2025-11-09 05:25:33 +08:00
wgsd-client: Add systemd timer/service example
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=WireGuard Service Discovery (wgsd) Client
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
LimitNOFILE=512
|
||||
LimitNPROC=16
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN
|
||||
AmbientCapabilities=CAP_NET_ADMIN
|
||||
NoNewPrivileges=true
|
||||
User=wgsd-client
|
||||
Group=wgsd-client
|
||||
DynamicUser=true
|
||||
EnvironmentFile=/etc/wgsd/%i.env
|
||||
ExecStart=/usr/local/bin/wgsd-client -device %i -dns $DNS -zone $ZONE
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Run WireGuard Service Discovery (wgsd) Client
|
||||
|
||||
[Timer]
|
||||
OnActiveSec=10
|
||||
OnUnitActiveSec=45
|
||||
AccuracySec=1s
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
2
cmd/wgsd-client/systemd/etc/wgsd/wg-example.template.env
Normal file
2
cmd/wgsd-client/systemd/etc/wgsd/wg-example.template.env
Normal file
@@ -0,0 +1,2 @@
|
||||
DNS=10.13.37.1:5353
|
||||
ZONE=wg.example.net.
|
||||
Reference in New Issue
Block a user