summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-12-05 15:20:49 +0100
committerlassulus <git@lassul.us>2023-12-05 15:20:49 +0100
commit3c84e737106c8ff38676861fdc1f7737a4fc2f73 (patch)
tree4b292d17275c2e458f22d93e158d8b88f6a81b93
parentc660bedbb94a9a08c50050a3447f4fc5ba90fd69 (diff)
sync-containers3: remove interface at container shutdown to avoid stuck containers
-rw-r--r--krebs/3modules/sync-containers3.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/krebs/3modules/sync-containers3.nix b/krebs/3modules/sync-containers3.nix
index 58446c82b..cb239b955 100644
--- a/krebs/3modules/sync-containers3.nix
+++ b/krebs/3modules/sync-containers3.nix
@@ -246,6 +246,9 @@ in {
}; }
{ "container@${ctr.name}" = lib.mkIf ctr.runContainer {
serviceConfig = {
+ ExecStop = pkgs.writers.writeDash "remove_interface" ''
+ ${pkgs.iproute2}/bin/ip link del vb-${ctr.name}
+ '';
ExecStartPost = [
(pkgs.writers.writeDash "bind-to-bridge" ''
${pkgs.iproute2}/bin/ip link set "vb-$INSTANCE" master ctr0