summaryrefslogtreecommitdiffstats
path: root/projectroot
diff options
context:
space:
mode:
authorBaeuerle, Florian <Florian.Baeuerle@allegion.com>2019-04-03 14:12:04 +0000
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-04-05 16:29:40 +0200
commit85758bda0d61ab6a103efa27427df14471be0713 (patch)
tree297f888a03d962719ca4d1ce20ef5b80470c11fc /projectroot
parentb8202ddcf19a197b2f96a8f2cd6ffb843b98811c (diff)
downloadptxdist-85758bda0d61ab6a103efa27427df14471be0713.tar.gz
ptxdist-85758bda0d61ab6a103efa27427df14471be0713.tar.xz
nftables: add option for installing systemd unit
Allow installing a systemd unit for loading the nftables configuration file. The systemd unit is taken from Arch Linux. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Acked-by: Alexander Dahl <post@lespocky.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'projectroot')
-rw-r--r--projectroot/usr/lib/systemd/system/nftables.service15
1 files changed, 15 insertions, 0 deletions
diff --git a/projectroot/usr/lib/systemd/system/nftables.service b/projectroot/usr/lib/systemd/system/nftables.service
new file mode 100644
index 000000000..16f390d6a
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/nftables.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Netfilter Tables
+Documentation=man:nft(8)
+Wants=network-pre.target
+Before=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/nft -f /etc/nftables.conf
+ExecReload=/usr/sbin/nft flush ruleset ';' include '"/etc/nftables.conf"'
+ExecStop=/usr/sbin/nft flush ruleset
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target