mirror of
https://github.com/jwhited/wgsd.git
synced 2025-04-03 18:49:32 +08:00
Merge 612d174160e7cc6a33bbe2e7c48e9cadb58d5680 into 537afbe95b2019ac8c32e700bd6d7dc2929e3187
This commit is contained in:
commit
5b60a66bb3
16
cmd/wgsd-client/systemd/README.md
Normal file
16
cmd/wgsd-client/systemd/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# wgsd-client systemd Integration
|
||||
|
||||
systemd timers can be used to periodically invoke `wgsd-client`.
|
||||
|
||||
## Installation
|
||||
|
||||
* Copy `wgsd-client@.service` to `/etc/systemd/system/`.
|
||||
* Copy `wgsd-client@.timer` to `/etc/systemd/system/`.
|
||||
|
||||
## Configuration
|
||||
|
||||
* To configure `wgsd-client` for WireGuard interface `wg-foo` copy `wg-example.template.env` to `/etc/wgsd/wg-foo.env` and adjust variables accordingly.
|
||||
|
||||
## Activation
|
||||
|
||||
* To activate periodic `wgsd-client` invocation for WireGuard interface `wg-foo` run `systemctl enable wgsd-client@wg-foo.timer`.
|
@ -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.
|
Loading…
x
Reference in New Issue
Block a user