diff options
author | William A. Kennington III <wak@google.com> | 2021-03-13 05:19:01 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2021-03-24 23:01:48 +0300 |
commit | cbb15ab4921045abe0c36de112e719108eb9b294 (patch) | |
tree | 0463cc76fff8f6b502281f43f5a12d34ff468fa1 /meta-google/recipes-google | |
parent | 6714373f115a916f5bd61bd96824f06d657f7bb1 (diff) | |
download | openbmc-cbb15ab4921045abe0c36de112e719108eb9b294.tar.xz |
meta-google: nftables-systemd: Flush at start
We don't want errors in loading previous rules to affect the state of the
ruleset during restart.
Change-Id: Ic122e971670d56022029f1155c1accdf129672d0
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google')
-rw-r--r-- | meta-google/recipes-google/nftables/files/nft-configure.sh | 1 | ||||
-rw-r--r-- | meta-google/recipes-google/nftables/files/nftables.service | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/meta-google/recipes-google/nftables/files/nft-configure.sh b/meta-google/recipes-google/nftables/files/nft-configure.sh index a82c2826f..05bb23d8b 100644 --- a/meta-google/recipes-google/nftables/files/nft-configure.sh +++ b/meta-google/recipes-google/nftables/files/nft-configure.sh @@ -9,6 +9,7 @@ for dir in /run/nftables /etc/nftables /usr/share/nftables; do let i+=1 done rc=0 +nft flush ruleset || rc=$? for key in $(printf "%s\n" "${!basemap[@]}" | sort -r); do echo "Executing ${basemap[$key]}" >&2 nft -f "${basemap[$key]}" || rc=$? diff --git a/meta-google/recipes-google/nftables/files/nftables.service b/meta-google/recipes-google/nftables/files/nftables.service index 79f0bb5b0..770a3d3ac 100644 --- a/meta-google/recipes-google/nftables/files/nftables.service +++ b/meta-google/recipes-google/nftables/files/nftables.service @@ -5,7 +5,7 @@ Before=network-pre.target Type=oneshot RemainAfterExit=yes ExecStart=/usr/libexec/nft-configure.sh -ExecStop=/bin/bash -c 'nft flush ruleset' +ExecStop=/usr/sbin/nft flush ruleset [Install] WantedBy=multi-user.target |