Verification for Focal (245.4-4ubuntu3.8)

# Initial repro on focal:

root@focal:~# md5sum /etc/resolv.conf; stat -t -L /etc/resolv.conf 
fbfde622ae28a4dcfbf73a397a10c6ae  /etc/resolv.conf
/etc/resolv.conf 717 8 81a4 101 103 76 123 1 0 0 1625844292 1625844273 
1625844273 0 4096
root@focal:~# ip link set eth0 down; sleep 1; ip link set eth0 up
root@focal:~# md5sum /etc/resolv.conf; stat -t -L /etc/resolv.conf 
fbfde622ae28a4dcfbf73a397a10c6ae  /etc/resolv.conf
/etc/resolv.conf 717 8 81a4 101 103 76 123 1 0 0 1625844310 1625844308 
1625844308 0 4096


# Upgrading to -proposed

root@focal:~# apt update && apt-get dist-upgrade -V
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease                          
              
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-proposed InRelease [267 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,086 
kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [239 
kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages 
[840 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-proposed/restricted amd64 Packages 
[191 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-proposed/restricted Translation-en 
[27.2 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages [203 
kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-proposed/main Translation-en 
[42.2 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse amd64 
Packages [18.2 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse 
Translation-en [6,732 B]
Get:14 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 Packages 
[56.2 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-proposed/universe Translation-en 
[24.5 kB]
Fetched 3,229 kB in 2s (1,428 kB/s)                               
Reading package lists... Done
Building dependency tree       
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
   libgnutls30 (3.6.13-2ubuntu1.3 => 3.6.13-2ubuntu1.5)
   libnss-systemd (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   libpam-systemd (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   libsystemd0 (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   libudev1 (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   systemd (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   systemd-sysv (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   systemd-timesyncd (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
   udev (245.4-4ubuntu3.7 => 245.4-4ubuntu3.8)
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,672 kB of archives.
After this operation, 15.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libnss-systemd 
amd64 245.4-4ubuntu3.8 [96.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 udev amd64 
245.4-4ubuntu3.8 [1,365 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libudev1 amd64 
245.4-4ubuntu3.8 [78.4 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 systemd-sysv 
amd64 245.4-4ubuntu3.8 [10.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
systemd-timesyncd amd64 245.4-4ubuntu3.8 [28.1 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libpam-systemd 
amd64 245.4-4ubuntu3.8 [186 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libgnutls30 
amd64 3.6.13-2ubuntu1.5 [828 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 systemd amd64 
245.4-4ubuntu3.8 [3,810 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 libsystemd0 
amd64 245.4-4ubuntu3.8 [271 kB]
Fetched 6,672 kB in 3s (2,541 kB/s)  
(Reading database ... 14718 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_245.4-4ubuntu3.8_amd64.deb ...
Unpacking libnss-systemd:amd64 (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../udev_245.4-4ubuntu3.8_amd64.deb ...
Unpacking udev (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../libudev1_245.4-4ubuntu3.8_amd64.deb ...
Unpacking libudev1:amd64 (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Setting up libudev1:amd64 (245.4-4ubuntu3.8) ...
(Reading database ... 14718 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_245.4-4ubuntu3.8_amd64.deb ...
Unpacking systemd-sysv (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../systemd-timesyncd_245.4-4ubuntu3.8_amd64.deb ...
Unpacking systemd-timesyncd (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../libpam-systemd_245.4-4ubuntu3.8_amd64.deb ...
Unpacking libpam-systemd:amd64 (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../libgnutls30_3.6.13-2ubuntu1.5_amd64.deb ...
Unpacking libgnutls30:amd64 (3.6.13-2ubuntu1.5) over (3.6.13-2ubuntu1.3) ...
Setting up libgnutls30:amd64 (3.6.13-2ubuntu1.5) ...
(Reading database ... 14718 files and directories currently installed.)
Preparing to unpack .../systemd_245.4-4ubuntu3.8_amd64.deb ...
Unpacking systemd (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Preparing to unpack .../libsystemd0_245.4-4ubuntu3.8_amd64.deb ...
Unpacking libsystemd0:amd64 (245.4-4ubuntu3.8) over (245.4-4ubuntu3.7) ...
Setting up libsystemd0:amd64 (245.4-4ubuntu3.8) ...
Setting up udev (245.4-4ubuntu3.8) ...
Setting up systemd (245.4-4ubuntu3.8) ...
Installing new version of config file /etc/dhcp/dhclient-enter-hooks.d/resolved 
...
Setting up systemd-timesyncd (245.4-4ubuntu3.8) ...
Setting up systemd-sysv (245.4-4ubuntu3.8) ...
Setting up libnss-systemd:amd64 (245.4-4ubuntu3.8) ...
Setting up libpam-systemd:amd64 (245.4-4ubuntu3.8) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...

# Config the fix worked:

root@focal:~# md5sum /etc/resolv.conf; stat -t -L /etc/resolv.conf 
fbfde622ae28a4dcfbf73a397a10c6ae  /etc/resolv.conf
/etc/resolv.conf 717 8 81a4 101 103 76 50 1 0 0 1625844400 1625844368 
1625844368 0 4096
root@focal:~# ip link set eth0 down; sleep 1; ip link set eth0 up
root@focal:~# md5sum /etc/resolv.conf; stat -t -L /etc/resolv.conf 
fbfde622ae28a4dcfbf73a397a10c6ae  /etc/resolv.conf
/etc/resolv.conf 717 8 81a4 101 103 76 50 1 0 0 1625844407 1625844368 
1625844368 0 4096

** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1891215

Title:
  systemd-resolved re-creates /run/systemd/resolve/*resolv.conf for
  every IPv6 RA received

Status in systemd:
  Unknown
Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Bionic:
  New
Status in systemd source package in Focal:
  Fix Committed
Status in systemd source package in Groovy:
  Fix Committed
Status in systemd source package in Hirsute:
  Fix Committed

Bug description:
  [impact]

  networking changes, like RA events, can cause systemd-resolved to re-
  write the resolv.conf file, even if the contents didn't change,
  resulting in unnecessary increased amount of inotify events

  [test case]

  see original description for ipv6ra-related reproducer, or simple
  reproducer here:

  configure networkd with some config for (e.g.) eth0, but not a config
  that would result in /etc/resolv.conf changing when the interface goes
  up/down - for example, use static config with no DNS search domains.
  Then bring eth0 up/down while observing the md5sum (file content) does
  not change but the mtime does change.

  root@lp1891215-h:~# ip l set down dev eth0
  root@lp1891215-h:~# md5sum /etc/resolv.conf
  db23e80078515192c312e5f321ff0340  /etc/resolv.conf
  root@lp1891215-h:~# stat -t -L /etc/resolv.conf
  /etc/resolv.conf 740 8 81a4 101 103 fc 188 1 0 0 1625238218 1625238216 
1625238216 0 4096
  root@lp1891215-h:~# ip l set up dev eth0
  root@lp1891215-h:~# md5sum /etc/resolv.conf
  db23e80078515192c312e5f321ff0340  /etc/resolv.conf
  root@lp1891215-h:~# stat -t -L /etc/resolv.conf
  /etc/resolv.conf 740 8 81a4 101 103 fc 188 1 0 0 1625238227 1625238226 
1625238226 0 4096

  [regression potential]

  regressions would result in incorrect or missing data in the
  resolv.conf file, possibly resulting in dns failures or errors

  [scope]

  this is needed for h and eralier

  this is (potentially) fixed upstream by
  f3e1f00d03445911ee73729219cea88c8a70c612 which in first included in
  v248, so this is needed in hirsute and earlier

  [original description]

  # Issue description:

  On 2 Linode VMs that are used as lxd hosts, we noticed that
  /run/systemd/resolve/*resolv.conf were re-created quite frequently (~
  once per second). We noticed because of the log noise from lxd's
  dnsmasq instance using inotify to watch the target of /etc/resolv.conf
  (which points to the stub-resolv.conf in our case). This was (wrongly)
  reported as a lxd bug (https://github.com/lxc/lxd/issues/7765) until
  it became apparent it was more likely to be a problem with
  systemd(-resolved)?.

  The log noise is the observable problem that would be nice to see
  addressed:

    root@lxd02:~# uptime
     17:55:48 up  9:52,  1 user,  load average: 0.18, 0.11, 0.05
    root@lxd02:~# journalctl -b0 | grep -cF dnsmasq
    158609

  Upon further investigation, it seems that systemd-resolved re-creates
  the resolv.conf and stub-resolv.conf files whenever an IPv6 RA is
  received.

  1) One can observe that by setting systemd-resolved's service in debug
  mode:

  $ sudo systemctl edit systemd-resolved

  and in the editor that is opened, add and save this content:

  [Service]
  Environment=SYSTEMD_LOG_LEVEL=debug

  then restart systemd-resolved and watch the logs scroll by with:

  $ journalctl -fu systemd-resolved

  3) In another terminal, watch the files be recreated with:

  watch -d -n 0.1 stat /run/systemd/resolve/stub-resolv.conf

  3) In yet another terminal, run a packet capture and watch "ICMP6,
  router advertisement" messages come by:

  sudo tcpdump -ni eth0 icmp6

  You will see that every time a RA packet comes in, resolved's journal
  will log this:

    Aug 11 17:33:55 lxd02 systemd-resolved[15368]: Sent message
  type=signal sender=n/a destination=n/a path=/org/freedesktop/resolve1
  interface=org.freedesktop.DBus.Properties member=PropertiesChanged
  cookie=244 reply_cookie=0 signature=sa{sv}as error-name=n/a error-
  message=n/a

  And the stat monitoring terminal will blink to highlight the new inode
  and timestamps of the freshly replaced stub-resolv.conf file.

  # Additional information:

  root@lxd02:~# lsb_release -rd
  Description:  Ubuntu 20.04.1 LTS
  Release:      20.04

  root@lxd02:~# apt-cache policy systemd
  systemd:
    Installed: 245.4-4ubuntu3.2
    Candidate: 245.4-4ubuntu3.2
    Version table:
   *** 245.4-4ubuntu3.2 500
          500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
          100 /var/lib/dpkg/status
       245.4-4ubuntu3 500
          500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

  root@lxd02:~# uname -a
  Linux lxd01 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 
x86_64 x86_64 x86_64 GNU/Linux

To manage notifications about this bug go to:
https://bugs.launchpad.net/systemd/+bug/1891215/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to