Patchwork [meta-oe,1/1] dhcp: add system support to dhcp-server

login
register
mail settings
Submitter Otavio Salvador
Date Nov. 7, 2011, 2:33 p.m.
Message ID <c910d23fec8138319d3ff83ad37ba89469267b86.1320676389.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/14409/
State Accepted
Commit 9292db41f1e1707e0c6864cedf95ce4d7b366e83
Headers show

Comments

Otavio Salvador - Nov. 7, 2011, 2:33 p.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../recipes-connectivity/dhcp/dhcp_4.2.0.bbappend  |   19 +++++++++++++++++++
 .../recipes-connectivity/dhcp/files/dhcpd.service  |   12 ++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
 create mode 100644 meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
Paul Menzel - Nov. 7, 2011, 6:05 p.m.
Dear Otavio,


thank you for the patch. system*d* in the commit summary.

Am Montag, den 07.11.2011, 14:33 +0000 schrieb Otavio Salvador:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  .../recipes-connectivity/dhcp/dhcp_4.2.0.bbappend  |   19 +++++++++++++++++++
>  .../recipes-connectivity/dhcp/files/dhcpd.service  |   12 ++++++++++++
>  2 files changed, 31 insertions(+), 0 deletions(-)
>  create mode 100644 meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
>  create mode 100644 meta-oe/recipes-connectivity/dhcp/files/dhcpd.service

[…]

> diff --git a/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
> new file mode 100644
> index 0000000..70beee9
> --- /dev/null
> +++ b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
> @@ -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

Did you write this yourself or did you get it from somewhere? Is
upstream aware of this?


Thanks,

Paul

Patch

diff --git a/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend b/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
new file mode 100644
index 0000000..d47f1ce
--- /dev/null
+++ b/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
@@ -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-oe/recipes-connectivity/dhcp/files/dhcpd.service b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 0000000..70beee9
--- /dev/null
+++ b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
@@ -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