systemd-nspawn and /run/resolvconf/resolv.conf

Ralf Mardorf ralf.mardorf at alice-dsl.net
Tue Sep 22 08:16:17 UTC 2015


On Mon, 21 Sep 2015 21:51:35 -0400, Tom H wrote:
>On Sun, Sep 20, 2015 at 1:11 PM, Ralf Mardorf
><ralf.mardorf at alice-dsl.net> wrote:
>>
>> by default Wily's /etc/resolv.conf is a link against
>> ../run/resolvconf/resolv.conf. If you want to maintain Wily from
>> another install in a systemd-nspawn container, the link needs to be
>> replaced by a file /etc/resolv.conf. Since Wily is based on systemd
>> by itself, it IMO should care about systemd-nspawn compatibility and
>> by default not link against /run.
>>
>> Assumed nobody should be aware about a reason that a link is a better
>> solution, I would report it as a bug.
>
>If you were to set up the "full systemd upstream experience", you'd be
>using systemd-resolved and "/etc/resolv.conf" would be a symlink to
>"/run/systemd/resolve/resolv.conf", so there's no reason why Ubuntu's
>default resolvconf setup shouldn't work, at least when using
>"systemd-nspawn -bD ...".

You are missing the point, Arch Linux does not split packages from
upstream. If I want to maintain Ubuntu from my Arch Linux install I
only get access to the Ubuntu repositories, if Ubuntu does not link.

[rocketmouse at archlinux ~]$ sudo systemd-nspawn -qD /mnt/moonstudio
[root at moonstudio ~]# ls -l /etc/resolv.*
-rw-r--r-- 1 root root 48 Sep 22 08:43 /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Jul 25 22:50 /etc/resolv.conf.bak -> ../run/resolvconf/resolv.conf
[root at moonstudio ~]# dpkg -l systemd-resolved
dpkg-query: no packages found matching systemd-resolved

As you can see systemd-resolved isn't installed, but I needed to replace
the link with a resolve.conf file.

Now I can

  [root at moonstudio ~]# apt-get update
  Ign http://de.archive.ubuntu.com wily InRelease
  Ign http://de.archive.ubuntu.com wily-updates InRelease
  Ign http://de.archive.ubuntu.com wily-backports InRelease
  Ign http://security.ubuntu.com wily-security InRelease
  Get:1 http://de.archive.ubuntu.com wily Release.gpg [933 B]
  Hit http://de.archive.ubuntu.com wily-updates Release.gpg  
  Hit http://de.archive.ubuntu.com wily-backports Release.gpg
  Hit http://security.ubuntu.com wily-security Release.gpg
  Get:2 http://de.archive.ubuntu.com wily Release [217 kB]
  Hit http://security.ubuntu.com wily-security Release 
  Hit http://security.ubuntu.com wily-security/main Sources
  Hit http://security.ubuntu.com wily-security/restricted Sources      
  Hit http://security.ubuntu.com wily-security/universe Sources        
  99% [2 Release 214 kB/217 kB 99%] [Waiting for headers]^C

But if I would keep the link

  [root at moonstudio ~]# mv -i /etc/resolv.conf /etc/resolv.conf.fix
  [root at moonstudio ~]# mv -i /etc/resolv.conf.bak /etc/resolv.conf 
  [root at moonstudio ~]# ls -l /etc/resolv.*
  lrwxrwxrwx 1 root root 29 Jul 25 22:50 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
  -rw-r--r-- 1 root root 48 Sep 22 08:43 /etc/resolv.conf.fix
  [root at moonstudio ~]# apt-get update
  Err http://de.archive.ubuntu.com wily InRelease
  
  Err http://security.ubuntu.com wily-security InRelease
  
  Err http://de.archive.ubuntu.com wily-updates InRelease
  
  Err http://de.archive.ubuntu.com wily-backports InRelease
  
  Err http://security.ubuntu.com wily-security Release.gpg
  Temporary failure resolving 'security.ubuntu.com'
  Err http://de.archive.ubuntu.com wily Release.gpg
  Temporary failure resolving 'de.archive.ubuntu.com'
  Err http://de.archive.ubuntu.com wily-updates Release.gpg
  Temporary failure resolving 'de.archive.ubuntu.com'
  Err http://de.archive.ubuntu.com wily-backports Release.gpg
  Temporary failure resolving 'de.archive.ubuntu.com'
  ^Cading package lists... 17%

And again, if I remove the annoying Ubuntu default link everything is
working again.

  [root at moonstudio ~]# mv -i /etc/resolv.conf /etc/resolv.conf.bak
  [root at moonstudio ~]# mv -i /etc/resolv.conf.fix /etc/resolv.conf 
  [root at moonstudio ~]# ls -l /etc/resolv.*
  -rw-r--r-- 1 root root 48 Sep 22 08:43 /etc/resolv.conf
  lrwxrwxrwx 1 root root 29 Jul 25 22:50 /etc/resolv.conf.bak -> ../run/resolvconf/resolv.conf
  [root at moonstudio ~]# apt-get update
  Ign http://de.archive.ubuntu.com wily InRelease
  Ign http://security.ubuntu.com wily-security InRelease
  Ign http://de.archive.ubuntu.com wily-updates InRelease
  Hit http://security.ubuntu.com wily-security Release.gpg
  Ign http://de.archive.ubuntu.com wily-backports InRelease
  Hit http://security.ubuntu.com wily-security Release

sytemd from upstream doesn't contain /etc/resolv.conf
https://www.archlinux.org/packages/core/x86_64/systemd/files/

Ubuntu and Arch's systemd from upstream contain another file.

  [root at moonstudio ~]# cat /etc/systemd/resolved.conf
  #  This file is part of systemd.
  #
  #  systemd is free software; you can redistribute it and/or modify it
  #  under the terms of the GNU Lesser General Public License as published by
  #  the Free Software Foundation; either version 2.1 of the License, or
  #  (at your option) any later version.
  #
  # Entries in this file show the compile time defaults.
  # You can change settings by editing this file.
  # Defaults can be restored by simply deleting this file.
  #
  # See resolved.conf(5) for details

  [Resolve]
  #DNS=
  #FallbackDNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
  #LLMNR=yes
  [root at moonstudio ~]# logout
  [rocketmouse at archlinux ~]$ cat /etc/systemd/resolved.conf
  #  This file is part of systemd.
  #
  #  systemd is free software; you can redistribute it and/or modify it
  #  under the terms of the GNU Lesser General Public License as published by
  #  the Free Software Foundation; either version 2.1 of the License, or
  #  (at your option) any later version.
  #
  # Entries in this file show the compile time defaults.
  # You can change settings by editing this file.
  # Defaults can be restored by simply deleting this file.
  #
  # See resolved.conf(5) for details

  [Resolve]
  #DNS=
  #FallbackDNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
  #LLMNR=yes

Perhaps this file could replace /etc/resolv.conf file and/or link.
I can't test it today.




More information about the Ubuntu-devel-discuss mailing list