mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Cc: "Florian Bäuerle" <florian.baeuerle@allegion.com>
Subject: Re: [ptxdist] [PATCH] nftables: add option for installing systemd unit
Date: Wed, 3 Apr 2019 18:58:41 +0200	[thread overview]
Message-ID: <20190403165841.nhd7uyk7dxdbymdq@falbala.home.lespocky.de> (raw)
In-Reply-To: <20190403141142.3743-1-florian.baeuerle@allegion.com>


[-- Attachment #1.1: Type: text/plain, Size: 2752 bytes --]

Hei hei,

On Wed, Apr 03, 2019 at 02:12:04PM +0000, Baeuerle, Florian wrote:
> 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>

Looks good, not tested however.

Acked-by: Alexander Dahl <post@lespocky.de>

> ---
>  .../usr/lib/systemd/system/nftables.service       | 15 +++++++++++++++
>  rules/nftables.in                                 |  6 ++++++
>  rules/nftables.make                               |  6 ++++++
>  3 files changed, 27 insertions(+)
>  create mode 100644 projectroot/usr/lib/systemd/system/nftables.service
> 
> 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
> diff --git a/rules/nftables.in b/rules/nftables.in
> index aafd7cdd6..089f68d2e 100644
> --- a/rules/nftables.in
> +++ b/rules/nftables.in
> @@ -36,4 +36,10 @@ config NFTABLES_STARTSCRIPT
>  	bool
>  	prompt "install /etc/init.d/nftables"
>  
> +config NFTABLES_SYSTEMD_UNIT
> +	bool
> +	default y
> +	depends on INITMETHOD_SYSTEMD
> +	prompt "install systemd unit file for nftables"
> +
>  endif
> diff --git a/rules/nftables.make b/rules/nftables.make
> index 4a95694ad..15368f965 100644
> --- a/rules/nftables.make
> +++ b/rules/nftables.make
> @@ -69,6 +69,12 @@ endif
>  endif
>  endif
>  
> +ifdef PTXCONF_NFTABLES_SYSTEMD_UNIT
> +	@$(call install_alternative, nftables, 0, 0, 0644, /usr/lib/systemd/system/nftables.service)
> +	@$(call install_link, nftables, ../nftables.service, \
> +		/usr/lib/systemd/system/multi-user.target.wants/nftables.service)
> +endif
> +
>  	@$(call install_finish, nftables)
>  
>  	@$(call touch)
> -- 
> 2.21.0
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN     | speech censured, the first thought forbidden, the
 X  AGAINST      | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 91 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2019-04-03 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 14:12 Baeuerle, Florian
2019-04-03 16:58 ` Alexander Dahl [this message]

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=20190403165841.nhd7uyk7dxdbymdq@falbala.home.lespocky.de \
    --to=post@lespocky.de \
    --cc=florian.baeuerle@allegion.com \
    --cc=ptxdist@pengutronix.de \
    /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