Re: How to create a systemd service that interact with nftables service
André Rodier <andre@rodier.me> writes:
> Hello, all.
>
> I have a simple script, to save / and store dynamic nftables sets.
>
> I would like to create a systemd service, that starts -after- nftables is started, and stops -before- nftables
> is
> stopped.
>
> Any idea on how to achieve this, please ?
It depends, but possibly you could just add calls to your "simple
script" on the ExecStart= and ExecStop= lines of the nftables
service. It's a list of commands with semicolons as separators.
> I tried to play a little with ‘Requires’ or ‘After’, without success.
I think those are a little more complicated than it seems on the
surface. Obvious point being, Before= and After= are ordering
constraints, Requires= is not.
Reply to: