summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-09-05 22:51:38 +0300
committerGitHub <noreply@github.com>2023-09-05 22:51:38 +0300
commit17d83fe780fd581f404c2e149facbffcb0d293c4 (patch)
tree54f02b9e3944c864e7a2daea1815e8580965596b /data/templates
parent8e22a2f6f77dc2d10969d8603c59a8834164b903 (diff)
parent24d65014bbdb2de0bde5ca9e5664baa9f7ac7121 (diff)
downloadvyos-1x-17d83fe780fd581f404c2e149facbffcb0d293c4.tar.gz
vyos-1x-17d83fe780fd581f404c2e149facbffcb0d293c4.zip
Merge pull request #2209 from sever-sever/T2958-sag
T2958: Refactor DHCP-server systemd unit and lease
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/dhcp-server/10-override.conf.j230
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..1504b6808
--- /dev/null
+++ b/data/templates/dhcp-server/10-override.conf.j2
@@ -0,0 +1,30 @@
+### Autogenerated by dhcp_server.py ###
+{% set lease_file = '/config/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