dhcp: add system support to dhcp-server
authorOtavio Salvador <otavio@ossystems.com.br>
Mon, 7 Nov 2011 14:33:49 +0000 (14:33 +0000)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:16:31 +0000 (08:16 -0800)
(From meta-openembedded rev: 9292db41f1e1707e0c6864cedf95ce4d7b366e83)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-openembedded/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend [new file with mode: 0644]
meta-openembedded/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service [new file with mode: 0644]

diff --git a/meta-openembedded/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend b/meta-openembedded/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
new file mode 100644 (file)
index 0000000..d47f1ce
--- /dev/null
@@ -0,0 +1,19 @@
+# look for files in the layer first
+FILESEXTRAPATHS := "${THISDIR}/files"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "dhcp-server-systemd"
+SYSTEMD_SERVICE_dhcp-server-systemd = "dhcpd.service"
+
+SRC_URI += "file://dhcpd.service"
+
+do_install_append() {
+    install -d ${D}${base_libdir}/systemd/system
+    install -m 644 ${WORKDIR}/dhcpd.service ${D}${base_libdir}/systemd/system
+}
+
+PACKAGES =+ "dhcp-server-systemd"
+
+FILES_dhcp-server-systemd += "${base_libdir}/systemd"
+RDEPENDS_dhcp-server-systemd += "dhcp-server"
diff --git a/meta-openembedded/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service b/meta-openembedded/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644 (file)
index 0000000..70beee9
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Dynamic Host Configuration Protocol (DHCP)
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/dhcpd.pid
+EnvironmentFile=-/etc/default/dhcp-server
+ExecStart=/usr/sbin/dhcpd -cf /etc/dhcp/dhcpd.conf -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target