From 63a464431bfa4168d381901c62e51048113d130c Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Tue, 3 Nov 2020 21:54:13 +0100 Subject: [PATCH] netns: fail when netns already exists Under normal circumstances, service-specific netns should never exist before the netns setup service starts. An existing netns is a genuine error that should not be silently ignored. --- modules/netns-isolation.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 9f49cef..d29d7a7 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -152,7 +152,6 @@ in { requiredBy = bindsTo; before = bindsTo; script = '' - ${ip} netns delete ${netnsName} 2> /dev/null || true ${ip} netns add ${netnsName} ${ipNetns} link set lo up ${ip} link add ${veth} type veth peer name ${peer}