[oe-commits] Chen Qi : dhcp: add dhcrelay.service
git at git.openembedded.org
git at git.openembedded.org
Tue Sep 2 13:50:18 UTC 2014
Module: openembedded-core.git
Branch: master-next
Commit: abca63f2a963b96bf8204436b161b0981e116fd0
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=abca63f2a963b96bf8204436b161b0981e116fd0
Author: Chen Qi <Qi.Chen at windriver.com>
Date: Tue Sep 2 18:53:57 2014 +0800
dhcp: add dhcrelay.service
Add dhcrelay.service to support systemd systems.
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-connectivity/dhcp/dhcp.inc | 9 +++++++--
meta/recipes-connectivity/dhcp/files/dhcrelay.service | 9 +++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc
index b281f94..f2b25a5 100644
--- a/meta/recipes-connectivity/dhcp/dhcp.inc
+++ b/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -17,14 +17,17 @@ SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
file://init-relay file://default-relay \
file://init-server file://default-server \
file://dhclient.conf file://dhcpd.conf \
- file://dhcpd.service"
+ file://dhcpd.service file://dhcrelay.service"
inherit autotools systemd
-SYSTEMD_PACKAGES = "dhcp-server"
+SYSTEMD_PACKAGES = "dhcp-server dhcp-relay"
SYSTEMD_SERVICE_dhcp-server = "dhcpd.service"
SYSTEMD_AUTO_ENABLE_dhcp-server = "disable"
+SYSTEMD_SERVICE_dhcp-relay = "dhcrelay.service"
+SYSTEMD_AUTO_ENABLE_dhcp-relay = "disable"
+
TARGET_CFLAGS += "-D_GNU_SOURCE"
EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
@@ -60,7 +63,9 @@ do_install_append () {
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
sed -i -e 's, at SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service
+ sed -i -e 's, at SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
}
PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
diff --git a/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 0000000..a2d8189
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid
+
+[Install]
+WantedBy=multi-user.target
More information about the Openembedded-commits
mailing list