[Bug 1891215] Re: systemd-resolved re-creates /run/systemd/resolve/*resolv.conf for every IPv6 RA received

Launchpad Bug Tracker 1891215 at bugs.launchpad.net
Mon Jul 19 20:18:15 UTC 2021


This bug was fixed in the package systemd - 246.6-1ubuntu1.5

---------------
systemd (246.6-1ubuntu1.5) groovy; urgency=medium

  [ Kai-Heng Feng ]
  * d/p/lp1930910-hwdb-Add-ProBook-to-use-micmute-hotkey.patch:
    - Add ProBook to use micmute hotkey (LP: #1930910)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=61d8acfdadb856cb408afde99f583142ec31b54e

  [ Jeremy Szu ]
  * d/p/lp1932352-hwdb-Add-mic-mute-key-mapping-for-HP-Elite-Dragonfly.patch:
    - Fix micmute hotkeys on HP Elite Dragonfly (LP: #1932352)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a635153cbd0542019190380c1f10fd86c12b537d

  [ Dan Streetman ]
  * d/p/lp1931578/0001-network-default-RequiredForOnline-false-if-Activacti.patch,
    d/p/lp1931578/0002-networkctl-add-field-Required-For-Online.patch,
    d/p/lp1931578/0003-test-add-test-to-verify-RequiredForOnline-setting-wi.patch:
    Adjust default for RequiredForOnline when using ActivationPolicy
    (LP: #1931578)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=9496d9934550d842609bf9d4aff8fc93eece1321
  * d/p/lp1894622-Add-systemd-resolve-backwards-compatibility-section-.patch:
    Add man page symlink and deprecation notice for systemd-resolve
    (LP: #1894622)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=bdcb37e447bf419cc3ff1082aec3427ab9ad0c47
  * d/p/lp1858210/0001-time-simplify-get_timezones.patch,
    d/p/lp1858210/0002-time-split-get_timezone-into-main-function-and-zone1.patch,
    d/p/lp1858210/0003-time-get-timezones-from-tzdata.zi.patch:
    Parse tzdata.zi so timedatectl list-timezones also lists aliases
    (LP: #1858210)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a64ac9f1413abd3b7d427560ac6c439ba916e542
  * d/p/lp1891215/0001-fs-util-add-conservative_rename-that-suppresses-unne.patch,
    d/p/lp1891215/0002-resolved-don-t-update-resolv.conf-snippets-unnecessa.patch,
    d/p/lp1891215/0003-fs-util-rename-conservative_rename-conservative_rena.patch,
    d/p/lp1891215/0004-fs-util-make-sure-conservative_renameat-properly-det.patch:
    Don't rewrite resolv.conf is content unchanged (LP: #1891215)
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=79ff24ba51d2239315d948e7dfb3e39769946937

 -- Dan Streetman <ddstreet at canonical.com>  Tue, 06 Jul 2021 14:00:27
-0400

** Changed in: systemd (Ubuntu Groovy)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, 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:
  Confirmed
Status in systemd source package in Focal:
  Fix Committed
Status in systemd source package in Groovy:
  Fix Released
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 at lp1891215-h:~# ip l set down dev eth0
  root at lp1891215-h:~# md5sum /etc/resolv.conf
  db23e80078515192c312e5f321ff0340  /etc/resolv.conf
  root at 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 at lp1891215-h:~# ip l set up dev eth0
  root at lp1891215-h:~# md5sum /etc/resolv.conf
  db23e80078515192c312e5f321ff0340  /etc/resolv.conf
  root at 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 at lxd02:~# uptime
     17:55:48 up  9:52,  1 user,  load average: 0.18, 0.11, 0.05
    root at 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 at lxd02:~# lsb_release -rd
  Description:	Ubuntu 20.04.1 LTS
  Release:	20.04

  root at 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 at 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




More information about the foundations-bugs mailing list