summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-09-03 15:09:07 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-03 11:09:05 +0100
commit9b5bc946e52c76b0f15c3576d9c6168a3bfcb767 (patch)
tree4662305a164f2fc9405b17e365e28448c1805090 /meta/recipes-connectivity/dhcp
parent198ed4b5bb11ea045b69523abb9244bd8d5df465 (diff)
downloadpoky-9b5bc946e52c76b0f15c3576d9c6168a3bfcb767.tar.gz
dhcp: add systemd service files
Add dhcpd.service and dhcrelay.service to support systemd systems. (From OE-Core rev: 5f40081b0b9867bc167057712b04b3c1afb8a20d) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/dhcp')
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp.inc23
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhcpd.service11
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhcrelay.service9
3 files changed, 39 insertions, 4 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc
index 512127cd4c..a1752548be 100644
--- a/meta/recipes-connectivity/dhcp/dhcp.inc
+++ b/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -14,11 +14,19 @@ DEPENDS = "openssl bind"
14 14
15SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \ 15SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
16 file://site.h \ 16 file://site.h \
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 21
21inherit autotools 22inherit autotools systemd
23
24SYSTEMD_PACKAGES = "dhcp-server dhcp-relay"
25SYSTEMD_SERVICE_dhcp-server = "dhcpd.service"
26SYSTEMD_AUTO_ENABLE_dhcp-server = "disable"
27
28SYSTEMD_SERVICE_dhcp-relay = "dhcrelay.service"
29SYSTEMD_AUTO_ENABLE_dhcp-relay = "disable"
22 30
23TARGET_CFLAGS += "-D_GNU_SOURCE" 31TARGET_CFLAGS += "-D_GNU_SOURCE"
24EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ 32EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
@@ -51,6 +59,13 @@ do_install_append () {
51 mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ 59 mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
52 fi 60 fi
53 install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script 61 install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
62
63 # Install systemd unit files
64 install -d ${D}${systemd_unitdir}/system
65 install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
66 install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
67 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service ${D}${systemd_unitdir}/system/dhcrelay.service
68 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd.service
54} 69}
55 70
56PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" 71PACKAGES += "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
new file mode 100644
index 0000000000..8648f1a253
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=DHCP Server Daemon
3After=network.target
4After=time-sync.target
5
6[Service]
7EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
8ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES
9
10[Install]
11WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 0000000000..a2d818917d
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,9 @@
1[Unit]
2Description=DHCP Relay Agent Daemon
3After=network.target
4
5[Service]
6ExecStart=@SBINDIR@/dhcrelay -d --no-pid
7
8[Install]
9WantedBy=multi-user.target