netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörg Thalheim" <joerg@higgsboson.tk>
To: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] add systemd service file
Date: Wed, 17 Dec 2014 21:40:32 +0100	[thread overview]
Message-ID: <20141217214032.569fbfac@turingmachine> (raw)
In-Reply-To: <20141217205407.06558f65@turingmachine>

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

Hi netfilter community,
Patrick McHardy ask me to submit our work on systemd support for
nftables (https://github.com/devkid/nftables-systemd)

It currently consists of a service file for systemd and a script to
load/remove nftables rules. The script does more than actually needed
for fundamental systemd support. 

It allows to test rules:

$ nftablesctl start --confirm

which resets after 20s if you accidentally kill your ssh connection.

It allows to list all rules with one command:

$ nftables list

Instead of storing all rules in a single file (/etc/nftables.conf), it
applys all files ending with .rules from directory /etc/nftables/ in
lexical order, which make it more useful for configuration management
like chef/puppet/ansible, where generating a single file from multiple
modules is a pain.

So the question is the nftables project wants such a script. If you are
just looking for a systemd service the following approach would be
much easier:

[Unit]
Description=Netfilter Tables
Documentation=man:nft(8)
Wants=network-pre.target
Before=network-pre.target

[Service]
Type=oneshot
ExecStart=/usr/bin/nft -f /etc/nftables.conf
ExecStop=/usr/lib/systemd/scripts/nftables-flush
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

where /usr/lib/systemd/scripts/nftables-flush would just drop all rules

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2014-12-17 20:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 19:54 [PATCH] add systemd service file Jörg Thalheim
2014-12-17 20:37 ` Arturo Borrero Gonzalez
2014-12-17 20:40 ` Jörg Thalheim [this message]
2014-12-17 20:55   ` Jan Engelhardt
2014-12-17 21:02   ` Jörg Thalheim
2014-12-17 20:50 ` Arturo Borrero Gonzalez
2014-12-17 20:55 ` Jan Engelhardt
2014-12-17 20:57 ` Jörg Thalheim
2014-12-17 21:10   ` Arturo Borrero Gonzalez
2014-12-17 21:36   ` Jörg Thalheim
2014-12-18  7:50   ` Jörg Thalheim
2014-12-17 21:12 ` Jörg Thalheim
  -- strict thread matches above, loose matches on Subject: below --
2014-12-18 12:47 Jörg Thalheim
2014-12-18 12:56 ` Jan Engelhardt
2014-12-18 13:02 ` Jörg Thalheim
2014-12-18 13:14   ` Jan Engelhardt
     [not found] <20141218133524.4d6e2539@turingmachine>
2014-12-18 12:47 ` Jörg Thalheim
2014-12-18 12:51   ` Pablo Neira Ayuso
2014-12-18 20:10 Jörg Thalheim
2014-12-18 20:12 ` Jörg Thalheim
2014-12-19 13:02 Jörg Thalheim
2014-12-19 13:08 ` Jörg Thalheim
2014-12-23 14:20 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141217214032.569fbfac@turingmachine \
    --to=joerg@higgsboson.tk \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).