[Bug 1089766] [NEW] correct resolvconf update order for resolv.conf file fix

diver 1089766 at bugs.launchpad.net
Thu Dec 13 04:55:12 UTC 2012


Public bug reported:

Out of box resolvconf improperly updates resolv.conf file. You will see
the following information in the /etc/resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search domain.actdsltmp
options edns0

As you can see, the 'search' line follows name server line. However,
'domain' and 'search' lines should appear before 'nameserver' line. The
update error happens due to order of entries in
/etc/resolvconf/update.d/libc. The included upstream data file 'libc' in
the package from ubuntu/debian packages/ports says:

### Make the file ###
: > "$TMPFILE"
[ -f "$HEADFILE" ] && cat "$HEADFILE" >> "$TMPFILE"
for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
[ "$SRCHS" ] && echo "search $SRCHS" >> "$TMPFILE"
[ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(nameserver\)\|\(search\)\|\(domain\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
[ -f "$TAILFILE" ] && cat "$TAILFILE" >> "$TMPFILE"

To see the proper order:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
search domain.actdsltmp
nameserver 127.0.0.1
options edns0

It should say something like this:
### Make the file ###

# so i did this to get the resolv conf file in etc to show search before nameserver entry
: > "$TMPFILE"
[ -f "$HEADFILE" ] && cat "$HEADFILE" >> "$TMPFILE"
[ "$SRCHS" ] && echo "search $SRCHS" >> "$TMPFILE"
for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
[ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(domain\)\|\(search\)\|\(nameserver\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
[ -f "$TAILFILE" ] && cat "$TAILFILE" >> "$TMPFILE"

The diff for two looks like this:
diff Desktop/libc2 Desktop/libc1
4d3
< for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
6c5,6
< [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(nameserver\)\|\(search\)\|\(domain\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
---
> for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
> [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(domain\)\|\(search\)\|\(nameserver\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: resolvconf 1.45ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-45.101-generic-pae 2.6.32.60+drm33.26
Uname: Linux 2.6.32-45-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Wed Dec 12 20:28:39 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04.2 LTS "Lucid Lynx" - Release i386 (20110214.1)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: resolvconf

** Affects: resolvconf (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 lucid

** Attachment added: "has lsb_release and apt cache policy"
   https://bugs.launchpad.net/bugs/1089766/+attachment/3458913/+files/aptcachepolicy

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to resolvconf in Ubuntu.
https://bugs.launchpad.net/bugs/1089766

Title:
  correct resolvconf update order for resolv.conf file fix

Status in “resolvconf” package in Ubuntu:
  New

Bug description:
  Out of box resolvconf improperly updates resolv.conf file. You will
  see the following information in the /etc/resolv.conf:

  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
  nameserver 127.0.0.1
  search domain.actdsltmp
  options edns0

  As you can see, the 'search' line follows name server line. However,
  'domain' and 'search' lines should appear before 'nameserver' line.
  The update error happens due to order of entries in
  /etc/resolvconf/update.d/libc. The included upstream data file 'libc'
  in the package from ubuntu/debian packages/ports says:

  ### Make the file ###
  : > "$TMPFILE"
  [ -f "$HEADFILE" ] && cat "$HEADFILE" >> "$TMPFILE"
  for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
  [ "$SRCHS" ] && echo "search $SRCHS" >> "$TMPFILE"
  [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(nameserver\)\|\(search\)\|\(domain\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
  [ -f "$TAILFILE" ] && cat "$TAILFILE" >> "$TMPFILE"

  To see the proper order:

  # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
  search domain.actdsltmp
  nameserver 127.0.0.1
  options edns0

  It should say something like this:
  ### Make the file ###

  # so i did this to get the resolv conf file in etc to show search before nameserver entry
  : > "$TMPFILE"
  [ -f "$HEADFILE" ] && cat "$HEADFILE" >> "$TMPFILE"
  [ "$SRCHS" ] && echo "search $SRCHS" >> "$TMPFILE"
  for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
  [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(domain\)\|\(search\)\|\(nameserver\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
  [ -f "$TAILFILE" ] && cat "$TAILFILE" >> "$TMPFILE"

  The diff for two looks like this:
  diff Desktop/libc2 Desktop/libc1
  4d3
  < for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
  6c5,6
  < [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(nameserver\)\|\(search\)\|\(domain\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null
  ---
  > for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done
  > [ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(domain\)\|\(search\)\|\(nameserver\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: resolvconf 1.45ubuntu1
  ProcVersionSignature: Ubuntu 2.6.32-45.101-generic-pae 2.6.32.60+drm33.26
  Uname: Linux 2.6.32-45-generic-pae i686
  NonfreeKernelModules: nvidia
  Architecture: i386
  Date: Wed Dec 12 20:28:39 2012
  EcryptfsInUse: Yes
  InstallationMedia: Ubuntu 10.04.2 LTS "Lucid Lynx" - Release i386 (20110214.1)
  PackageArchitecture: all
  ProcEnviron:
   PATH=(custom, no user)
   LANG=en_US.utf8
   SHELL=/bin/bash
  SourcePackage: resolvconf

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1089766/+subscriptions




More information about the foundations-bugs mailing list