diff options
author | Li Zhou <li.zhou@windriver.com> | 2016-09-26 10:24:28 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-10-20 11:17:01 -0400 |
commit | a0e2240e0a7300dfc20b11e7057156158c42aca9 (patch) | |
tree | 97b9d92119861d9ddbc9ee4287ad48e323ae019a /meta-networking/recipes-support | |
parent | 93b0d657931c9ea7a6fc0df8ca9925a0fa7a80cc (diff) | |
download | meta-openembedded-a0e2240e0a7300dfc20b11e7057156158c42aca9.tar.gz |
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@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support')
-rw-r--r-- | meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service | 16 | ||||
-rw-r--r-- | meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb | 10 |
2 files changed, 26 insertions, 0 deletions
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 000000000..fa6434265 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables.service | |||
@@ -0,0 +1,16 @@ | |||
1 | [Unit] | ||
2 | Description=Arp filtering arptables | ||
3 | After=network.target | ||
4 | Requires=network.target | ||
5 | |||
6 | [Service] | ||
7 | Type=oneshot | ||
8 | ExecStartPre=/bin/sh -c "if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi" | ||
9 | ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables" | ||
10 | ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables" | ||
11 | RemainAfterExit=yes | ||
12 | ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null" | ||
13 | ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables" | ||
14 | |||
15 | [Install] | ||
16 | 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 be2ac6659..f53640847 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 = " \ | |||
13 | file://arptables-init-busybox.patch \ | 13 | file://arptables-init-busybox.patch \ |
14 | file://arptables-arpt-get-target-fix.patch \ | 14 | file://arptables-arpt-get-target-fix.patch \ |
15 | file://arptables-remove-bashism.patch \ | 15 | file://arptables-remove-bashism.patch \ |
16 | file://arptables.service \ | ||
16 | " | 17 | " |
17 | SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" | 18 | SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" |
18 | SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" | 19 | SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" |
@@ -31,3 +32,12 @@ PARALLEL_MAKEINST = "-j1" | |||
31 | fakeroot do_install () { | 32 | fakeroot do_install () { |
32 | oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install | 33 | oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install |
33 | } | 34 | } |
35 | |||
36 | do_install_append() { | ||
37 | install -d ${D}${systemd_unitdir}/system | ||
38 | install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system | ||
39 | } | ||
40 | |||
41 | inherit systemd | ||
42 | |||
43 | SYSTEMD_SERVICE_${PN} = "arptables.service" | ||