diff options
author | Christian Breunig <christian@breunig.cc> | 2023-09-05 07:23:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 07:23:34 +0200 |
commit | 487c817ea320ddabcdaf41a8112937a29c19443e (patch) | |
tree | 804576d13ce30511ef21c10cb71026290561e52c /data | |
parent | 77937079d93abd86cf44bf6eb72d9afed741b1cb (diff) | |
parent | c07055258b853de641d2a1353582800b24c514d2 (diff) | |
download | vyos-1x-487c817ea320ddabcdaf41a8112937a29c19443e.tar.gz vyos-1x-487c817ea320ddabcdaf41a8112937a29c19443e.zip |
Merge pull request #2184 from sever-sever/T2958
T2958: Refactor DHCP-server systemd unit and lease
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/dhcp-server/10-override.conf.j2 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/10-override.conf.j2 b/data/templates/dhcp-server/10-override.conf.j2 new file mode 100644 index 000000000..dd5730b90 --- /dev/null +++ b/data/templates/dhcp-server/10-override.conf.j2 @@ -0,0 +1,30 @@ +### Autogenerated by dhcp_server.py ### +{% set lease_file = '/run/dhcp-server/dhcpd.leases' %} +[Unit] +Description=ISC DHCP IPv4 server +Documentation=man:dhcpd(8) +RequiresMountsFor=/run +ConditionPathExists= +ConditionPathExists=/run/dhcp-server/dhcpd.conf +After= +After=vyos-router.service + +[Service] +Type=forking +WorkingDirectory= +WorkingDirectory=/run/dhcp-server +RuntimeDirectory=dhcp-server +RuntimeDirectoryPreserve=yes +Environment=PID_FILE=/run/dhcp-server/dhcpd.pid CONFIG_FILE=/run/dhcp-server/dhcpd.conf LEASE_FILE={{ lease_file }} +PIDFile=/run/dhcp-server/dhcpd.pid +ExecStartPre=/bin/sh -ec '\ +touch ${LEASE_FILE}; \ +chown dhcpd:vyattacfg ${LEASE_FILE}* ; \ +chmod 664 ${LEASE_FILE}* ; \ +/usr/sbin/dhcpd -4 -t -T -q -user dhcpd -group vyattacfg -pf ${PID_FILE} -cf ${CONFIG_FILE} -lf ${LEASE_FILE} ' +ExecStart= +ExecStart=/usr/sbin/dhcpd -4 -q -user dhcpd -group vyattacfg -pf ${PID_FILE} -cf ${CONFIG_FILE} -lf ${LEASE_FILE} +Restart=always + +[Install] +WantedBy=multi-user.target |