[oe-commits] [meta-openembedded] 13/21: arptables: add arptables systemd service file

git at git.openembedded.org git at git.openembedded.org
Thu Oct 20 19:13:05 UTC 2016


joe_macdonald pushed a commit to branch master
in repository meta-openembedded.

commit a0e2240e0a7300dfc20b11e7057156158c42aca9
Author: Li Zhou <li.zhou at windriver.com>
AuthorDate: Mon Sep 26 10:24:28 2016 +0800

    arptables: add arptables systemd service file
    
    Add arptables systemd service file.
    If there isn't any configuration file (/etc/sysconfig/arptables),
    add a default configuration file.
    
    Signed-off-by: Li Zhou <li.zhou at windriver.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
    Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
---
 .../arptables/arptables-0.0.3-4/arptables.service        | 16 ++++++++++++++++
 .../recipes-support/arptables/arptables_0.0.3-4.bb       | 10 ++++++++++
 2 files changed, 26 insertions(+)

diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service
new file mode 100644
index 0000000..fa64342
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Arp filtering arptables
+After=network.target
+Requires=network.target
+
+[Service]
+Type=oneshot
+ExecStartPre=/bin/sh -c "if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi"
+ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables"
+ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables"
+RemainAfterExit=yes
+ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null"
+ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
index be2ac66..f536408 100644
--- a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
+++ b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
@@ -13,6 +13,7 @@ SRC_URI = " \
     file://arptables-init-busybox.patch \
     file://arptables-arpt-get-target-fix.patch \
     file://arptables-remove-bashism.patch \
+    file://arptables.service \
 "
 SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
 SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
@@ -31,3 +32,12 @@ PARALLEL_MAKEINST = "-j1"
 fakeroot do_install () {
     oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install
 }
+
+do_install_append() {
+    install -d ${D}${systemd_unitdir}/system
+    install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system
+}
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "arptables.service"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list