<div dir="ltr">Please use ${systemd_system_unitdir} instead of ${systemd_unitdir}/system</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Pau Espin Pedrol<br>mail/jabber: <a href="mailto:pespin.shar@gmail.com" target="_blank">pespin.shar@gmail.com</a><br><a href="http://blog.espeweb.net" target="_blank">http://blog.espeweb.net</a><br></div></div>
<br><div class="gmail_quote">2016-02-02 5:19 GMT+01:00 Li Xin <span dir="ltr"><<a href="mailto:lixin.fnst@cn.fujitsu.com" target="_blank">lixin.fnst@cn.fujitsu.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Add iptables.service & ip6tables.service to support systemd systems.<br>
<br>
Signed-off-by: Li Xin <<a href="mailto:lixin.fnst@cn.fujitsu.com">lixin.fnst@cn.fujitsu.com</a>><br>
---<br>
.../iptables/iptables/ip6tables.service | 17 +++++++++++++++++<br>
.../recipes-extended/iptables/iptables/iptables.service | 17 +++++++++++++++++<br>
meta/recipes-extended/iptables/<a href="http://iptables_1.4.21.bb" rel="noreferrer" target="_blank">iptables_1.4.21.bb</a> | 16 +++++++++++++++-<br>
3 files changed, 49 insertions(+), 1 deletion(-)<br>
create mode 100644 meta/recipes-extended/iptables/iptables/ip6tables.service<br>
create mode 100644 meta/recipes-extended/iptables/iptables/iptables.service<br>
<br>
diff --git a/meta/recipes-extended/iptables/iptables/ip6tables.service b/meta/recipes-extended/iptables/iptables/ip6tables.service<br>
new file mode 100644<br>
index 0000000..148a1b9<br>
--- /dev/null<br>
+++ b/meta/recipes-extended/iptables/iptables/ip6tables.service<br>
@@ -0,0 +1,17 @@<br>
+[Unit]<br>
+Description=IPv6 firewall with ip6tables<br>
+After=syslog.target<br>
+ConditionPathExists=/etc/default/iptables<br>
+<br>
+[Service]<br>
+Type=oneshot<br>
+RemainAfterExit=yes<br>
+ExecStart=/usr/libexec/iptables/ip6tables.init start<br>
+ExecStop=/usr/libexec/iptables/ip6tables.init stop<br>
+Environment=BOOTUP=serial<br>
+Environment=CONSOLETYPE=serial<br>
+StandardOutput=syslog<br>
+StandardError=syslog<br>
+<br>
+[Install]<br>
+WantedBy=basic.target<br>
diff --git a/meta/recipes-extended/iptables/iptables/iptables.service b/meta/recipes-extended/iptables/iptables/iptables.service<br>
new file mode 100644<br>
index 0000000..9745c71<br>
--- /dev/null<br>
+++ b/meta/recipes-extended/iptables/iptables/iptables.service<br>
@@ -0,0 +1,17 @@<br>
+[Unit]<br>
+Description=IPv4 firewall with iptables<br>
+After=syslog.target<br>
+ConditionPathExists=/etc/default/iptables<br>
+<br>
+[Service]<br>
+Type=oneshot<br>
+RemainAfterExit=yes<br>
+ExecStart=/usr/libexec/iptables/iptables.init start<br>
+ExecStop=/usr/libexec/iptables/iptables.init stop<br>
+Environment=BOOTUP=serial<br>
+Environment=CONSOLETYPE=serial<br>
+StandardOutput=syslog<br>
+StandardError=syslog<br>
+<br>
+[Install]<br>
+WantedBy=basic.target<br>
diff --git a/meta/recipes-extended/iptables/<a href="http://iptables_1.4.21.bb" rel="noreferrer" target="_blank">iptables_1.4.21.bb</a> b/meta/recipes-extended/iptables/<a href="http://iptables_1.4.21.bb" rel="noreferrer" target="_blank">iptables_1.4.21.bb</a><br>
index deea5e5..84c95ea 100644<br>
--- a/meta/recipes-extended/iptables/<a href="http://iptables_1.4.21.bb" rel="noreferrer" target="_blank">iptables_1.4.21.bb</a><br>
+++ b/meta/recipes-extended/iptables/<a href="http://iptables_1.4.21.bb" rel="noreferrer" target="_blank">iptables_1.4.21.bb</a><br>
@@ -24,12 +24,14 @@ SRC_URI = "<a href="http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2" rel="noreferrer" target="_blank">http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2</a> \<br>
file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \<br>
file://0001-fix-build-with-musl.patch \<br>
file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \<br>
+ file://iptables.service \<br>
+ file://ip6tables.service \<br>
"<br>
<br>
SRC_URI[md5sum] = "536d048c8e8eeebcd9757d0863ebb0c0"<br>
SRC_URI[sha256sum] = "52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0"<br>
<br>
-inherit autotools pkgconfig<br>
+inherit autotools pkgconfig systemd<br>
<br>
EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \<br>
"<br>
@@ -46,3 +48,15 @@ do_configure_prepend() {<br>
# Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.<br>
rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4<br>
}<br>
+<br>
+do_install_append() {<br>
+ install -d ${D}${systemd_unitdir}/system<br>
+ install -m 0644 ${WORKDIR}/ip6tables.service ${D}${systemd_unitdir}/system/<br>
+ install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_unitdir}/system/<br>
+ sed -i -e "s,/usr/libexec/iptables,${libexecdir},g" \<br>
+ ${D}${systemd_unitdir}/system/iptables.service<br>
+ sed -i -e "s,/usr/libexec/iptables,${libexecdir},g" \<br>
+ ${D}${systemd_unitdir}/system/ip6tables.service<br>
+}<br>
+<br>
+SYSTEMD_SERVICE_${PN} = "iptables.service ip6tables.service"<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.2<br>
<br>
<br>
<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</font></span></blockquote></div><br></div>