diff options
| -rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp.inc | 12 | ||||
| -rw-r--r-- | meta/recipes-connectivity/dhcp/files/dhcpd.service | 8 | ||||
| -rw-r--r-- | meta/recipes-connectivity/dhcp/files/dhcpd6.service | 15 |
3 files changed, 29 insertions, 6 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc index 6ced77500a..3bf1ea958d 100644 --- a/meta/recipes-connectivity/dhcp/dhcp.inc +++ b/meta/recipes-connectivity/dhcp/dhcp.inc | |||
| @@ -17,12 +17,13 @@ SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \ | |||
| 17 | file://init-relay file://default-relay \ | 17 | file://init-relay file://default-relay \ |
| 18 | file://init-server file://default-server \ | 18 | file://init-server file://default-server \ |
| 19 | file://dhclient.conf file://dhcpd.conf \ | 19 | file://dhclient.conf file://dhcpd.conf \ |
| 20 | file://dhcpd.service file://dhcrelay.service" | 20 | file://dhcpd.service file://dhcrelay.service \ |
| 21 | file://dhcpd6.service " | ||
| 21 | 22 | ||
| 22 | inherit autotools systemd | 23 | inherit autotools systemd |
| 23 | 24 | ||
| 24 | SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay" | 25 | SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay" |
| 25 | SYSTEMD_SERVICE_${PN}-server = "dhcpd.service" | 26 | SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service" |
| 26 | SYSTEMD_AUTO_ENABLE_${PN}-server = "disable" | 27 | SYSTEMD_AUTO_ENABLE_${PN}-server = "disable" |
| 27 | 28 | ||
| 28 | SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service" | 29 | SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service" |
| @@ -59,9 +60,12 @@ do_install_append () { | |||
| 59 | # Install systemd unit files | 60 | # Install systemd unit files |
| 60 | install -d ${D}${systemd_unitdir}/system | 61 | install -d ${D}${systemd_unitdir}/system |
| 61 | install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system | 62 | install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system |
| 63 | install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system | ||
| 62 | install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system | 64 | install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system |
| 63 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service ${D}${systemd_unitdir}/system/dhcrelay.service | 65 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service |
| 64 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd.service | 66 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service |
| 67 | sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service | ||
| 68 | sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service | ||
| 65 | } | 69 | } |
| 66 | 70 | ||
| 67 | PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" | 71 | PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" |
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd.service b/meta/recipes-connectivity/dhcp/files/dhcpd.service index 8648f1a253..ae4f93eca5 100644 --- a/meta/recipes-connectivity/dhcp/files/dhcpd.service +++ b/meta/recipes-connectivity/dhcp/files/dhcpd.service | |||
| @@ -1,11 +1,15 @@ | |||
| 1 | [Unit] | 1 | [Unit] |
| 2 | Description=DHCP Server Daemon | 2 | Description=DHCPv4 Server Daemon |
| 3 | Documentation=man:dhcpd(8) man:dhcpd.conf(5) | ||
| 3 | After=network.target | 4 | After=network.target |
| 4 | After=time-sync.target | 5 | After=time-sync.target |
| 5 | 6 | ||
| 6 | [Service] | 7 | [Service] |
| 8 | PIDFile=@localstatedir@/run/dhcpd.pid | ||
| 7 | EnvironmentFile=@SYSCONFDIR@/default/dhcp-server | 9 | EnvironmentFile=@SYSCONFDIR@/default/dhcp-server |
| 8 | ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES | 10 | EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server |
| 11 | ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases | ||
| 12 | ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES | ||
| 9 | 13 | ||
| 10 | [Install] | 14 | [Install] |
| 11 | WantedBy=multi-user.target | 15 | WantedBy=multi-user.target |
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd6.service b/meta/recipes-connectivity/dhcp/files/dhcpd6.service new file mode 100644 index 0000000000..ca96abb838 --- /dev/null +++ b/meta/recipes-connectivity/dhcp/files/dhcpd6.service | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=DHCPv6 Server Daemon | ||
| 3 | Documentation=man:dhcpd(8) man:dhcpd.conf(5) | ||
| 4 | After=network.target | ||
| 5 | After=time-sync.target | ||
| 6 | |||
| 7 | [Service] | ||
| 8 | PIDFile=@localstatedir@/run/dhcpd6.pid | ||
| 9 | EnvironmentFile=@SYSCONFDIR@/default/dhcp-server | ||
| 10 | EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6 | ||
| 11 | ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases | ||
| 12 | ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES | ||
| 13 | |||
| 14 | [Install] | ||
| 15 | WantedBy=multi-user.target | ||
