-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd service with JoinsNamespaceOf= does not use separate resolv.conf for that netns #31
Comments
I found that the mount namespace of the netns is actually created by
So to let systemd service use |
I never had this issue with Ubuntu 20.04 but I recently installed 22.04 and after re-setting all of this up I am encountering this exact issue I believe. My netns@ My netns.conf file inside my service directory is:
A test service file that uses the netns.conf looks like this:
If I use I haven't found the best way to fix this yet - could it be something different in 22.04 (like systemd-resolved) that's causing this to not work? |
I ended up having to do a custom script to create the netns, get it attached to a nic and get it online, and then added a service override netns.conf to each of my units:
|
I created a netns called
warp
usenetns@warp.service
, and create/etc/netns/warp/resolv.conf
, then:Processes run by
ip netns exec warp
use separate netns and mount namespace, and it uses the separateresolv.conf
I also run a systemd service (warp-svc) with
JoinsNamespaceOf=netns@warp.service
, however:It only changes the netns, the mount namespace remains the same as pid 1, and therefore this process does not use the separate
resolv.conf
The text was updated successfully, but these errors were encountered: