Skip to content

Commit

Permalink
update systemd override to include restart-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Jul 29, 2024
1 parent a9b0e04 commit e08bd29
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,21 @@ If you want to be even safer - you can add a config-validation inside the `nftab
```text
# /etc/systemd/system/nftables.service.d/override.conf
[Service]
# catch errors at start
ExecStartPre=/usr/sbin/nft -cf /etc/nftables.conf
# catch errors at reload
ExecReload=
ExecReload=/usr/sbin/nft -cf /etc/nftables.conf
ExecReload=/usr/sbin/nft -f /etc/nftables.conf
# catch errors at restart
ExecStop=
ExecStop=/usr/sbin/nft -cf /etc/nftables.conf
ExecStop=/usr/sbin/nft flush ruleset
Restart=on-failure
RestartSec=5s
```

This will catch and log config-errors before doing a reload/restart.
Expand Down

0 comments on commit e08bd29

Please sign in to comment.