Merge ~vorlon/ubuntu/+source/resolvconf:ubuntu/devel into ubuntu/+source/resolvconf:ubuntu/devel

Proposed by Steve Langasek
Status: Needs review
Proposed branch: ~vorlon/ubuntu/+source/resolvconf:ubuntu/devel
Merge into: ubuntu/+source/resolvconf:ubuntu/devel
Diff against target: 343 lines (+52/-183)
6 files modified
debian/changelog (+18/-0)
debian/postinst (+22/-52)
debian/resolvconf.maintscript (+1/-0)
debian/rules (+0/-1)
dev/null (+0/-81)
etc/resolvconf/update.d/libc (+11/-49)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Pending
Review via email: mp+382826@code.launchpad.net
To post a comment you must log in.
1bfeda0... by Steve Langasek

Suppress warning message that /etc/resolv.conf is not a symlink to the resolvconf-managed file, since it now never will be.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Code review good.

Proceeding to test build and interractively test.

Unmerged commits

1bfeda0... by Steve Langasek

Suppress warning message that /etc/resolv.conf is not a symlink to the resolvconf-managed file, since it now never will be.

318150c... by Steve Langasek

Restart systemd-resolved after writing the config file, as systemd-resolved does not appear to watch the config directories for updates as one would expect.

32457f0... by Steve Langasek

Drop the systemd units that only exist for pulling resolved state into resolvconf.

9dfc86c... by Steve Langasek

Make resolvconf feed changes into /run/systemd/resolved.conf.d instead of updating a resolv.conf file.

f79f3b2... by Steve Langasek

Fix wrong spelling of rm_conffile

08cc6d7... by Steve Langasek

add bug link

c84ad81... by Steve Langasek

Revert any symlinking of /etc/resolv.conf to resolvconf's file, pointing it instead to the resolved file.

133ae11... by Steve Langasek

Drop the dhclient hook: on Ubuntu, DNS configuration will instead be fed directly to resolved via a hook provided by ifupdown.

eabed2a... by Andrej Shadura

Import patches-unapplied version 1.82 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 3f2ee40ab584dcaa10b43622fe754a05981204a9

New changelog entries:
  [ Andrej Shadura ]
  * Update the debconf translation templates (Closes: #947164).
  * Update translations.
  [ Helge Kreutzmann ]
  * Update German debconf translation (Closes: #947171).
  [ Frans Spiesschaert ]
  * Update Dutch debconf translation (Closes: #948037).

3f2ee40... by Andrej Shadura

Import patches-unapplied version 1.81 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 3dbe8b345728756b17c277563c09420cb51732d2

New changelog entries:
  [ Russell Coker ]
  * Set correct SE Linux context on created directories and files
    (Closes: #850783).
  [ Jakub Wilk ]
  * Drop symlink resolving logic from the init script (Closes: #946609).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 9048ad8..d56c5ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
1resolvconf (1.82ubuntu1) UNRELEASED; urgency=medium
2
3 * Drop the dhclient hook: on Ubuntu, DNS configuration will instead be
4 fed directly to resolved via a hook provided by ifupdown. LP: #1874337.
5 * Revert any symlinking of /etc/resolv.conf to resolvconf's file, pointing
6 it instead to the resolved file.
7 * Make resolvconf feed changes into /run/systemd/resolved.conf.d
8 instead of updating a resolv.conf file.
9 * Drop the systemd units that only exist for pulling resolved state into
10 resolvconf.
11 * Restart systemd-resolved after writing the config file, as
12 systemd-resolved does not appear to watch the config directories for
13 updates as one would expect.
14 * Suppress warning message that /etc/resolv.conf is not a symlink to the
15 resolvconf-managed file, since it now never will be.
16
17 -- Steve Langasek <steve.langasek@ubuntu.com> Tue, 21 Apr 2020 23:51:11 -0700
18
1resolvconf (1.82) unstable; urgency=medium19resolvconf (1.82) unstable; urgency=medium
220
3 [ Andrej Shadura ]21 [ Andrej Shadura ]
diff --git a/debian/postinst b/debian/postinst
index 40cd101..22b64c0 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -52,9 +52,28 @@ esac
52#52#
53case "$1" in53case "$1" in
54 configure)54 configure)
55 # Do linkify once again on dpkg-reconfigure55 # Unconditionally re-link this to resolved on upgrade. resolvconf
56 if [ "$DEBCONF_RECONFIGURE" = 1 ] || [ "$1" = reconfigure ] ; then56 # management of /etc/resolv.conf is unsupported on Ubuntu.
57 rm -f /var/lib/resolvconf/linkified57 if dpkg --compare-versions "$2" lt-nl 1.82ubuntu1~ \
58 && [ "$(readlink -m /etc/resolv.conf)" = "/run/resolvconf/resolv.conf" ]
59 then
60 if is_immutable_file /etc/resolv.conf ; then
61 if dnssec_trigger_is_installed ; then
62 # dnssec-trigger sets the immutability attribute. Override it.
63 # See #776778 for background.
64 chattr -i /etc/resolv.conf
65 else
66 # Respect the admin
67 report_err "Cannot replace the current /etc/resolv.conf with a symbolic link because it is immutable; to correct this problem, gain root privileges in a terminal and run 'chattr -i /etc/resolv.conf' and then 'dpkg --configure resolvconf'; aborting"
68 exit 1
69 fi
70 fi
71 rm -f /etc/resolv.conf
72 ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
73
74 # we are "done" and nothing that looks at this file should ever
75 # think otherwise
76 :> /var/lib/resolvconf/linkified
58 fi77 fi
5978
60 # Link tail to original if appropriate79 # Link tail to original if appropriate
@@ -67,55 +86,6 @@ case "$1" in
67 fi86 fi
68 fi87 fi
6988
70 # Linkify /etc/resolv.conf if appropriate
71 if [ ! -e /var/lib/resolvconf/linkified ] ; then
72 db_get resolvconf/linkify-resolvconf
73 if [ "$RET" = "true" ] ; then
74 if is_immutable_file /etc/resolv.conf ; then
75 if dnssec_trigger_is_installed ; then
76 # dnssec-trigger sets the immutability attribute. Override it.
77 # See #776778 for background.
78 chattr -i /etc/resolv.conf
79 else
80 # Respect the admin
81 report_err "Cannot replace the current /etc/resolv.conf with a symbolic link because it is immutable; to correct this problem, gain root privileges in a terminal and run 'chattr -i /etc/resolv.conf' and then 'dpkg --configure resolvconf'; aborting"
82 exit 1
83 fi
84 else
85 if
86 [ -f /etc/resolv.conf ] \
87 && {
88 [ ! -L /etc/resolv.conf ] \
89 || [ ! "$(readlink -m /etc/resolv.conf)" = "/run/resolvconf/resolv.conf" ]
90 }
91 then
92 # Back up original file
93 if [ ! -e /etc/resolvconf/resolv.conf.d/original ] ; then
94 cp -a /etc/resolv.conf /etc/resolvconf/resolv.conf.d/original
95 else
96 cp -a /etc/resolv.conf /etc/resolv.conf.dpkg-old
97 fi
98 # Before creating the link, make sure that the original file is
99 # at the target of the link. /sbin/resolvconf will overwrite
100 # this when it does an update, of course.
101 if [ ! -e /run/resolvconf/resolv.conf ] ; then
102 cp -aH /etc/resolv.conf /run/resolvconf/resolv.conf
103 fi
104 # Add the original file to the database so that its contents
105 # are included when resolvconf updates.
106 # Yes, this is an ugly workaround for the problem that some
107 # interface configurers haven't added a dpkg-event.d script.
108 cp -aH /etc/resolv.conf /run/resolvconf/interface/original.resolvconf
109 fi
110 # Create the link
111 # The link is relative to allow for cp from outside a chroot into a chroot
112 # to work without overwriting the file outside the chroot (or failing)
113 ln -nsf ../run/resolvconf/resolv.conf /etc/resolv.conf
114 # Make a record that we have created it
115 :> /var/lib/resolvconf/linkified
116 fi
117 fi
118 fi
119 ;;89 ;;
120 # triggered)90 # triggered)
121 # Don't do anything here91 # Don't do anything here
diff --git a/debian/resolvconf.maintscript b/debian/resolvconf.maintscript
index 2e88567..e27c872 100644
--- a/debian/resolvconf.maintscript
+++ b/debian/resolvconf.maintscript
@@ -1 +1,2 @@
1rm_conffile /etc/init/resolvconf.conf 1.80~~1rm_conffile /etc/init/resolvconf.conf 1.80~~
2rm_conffile /etc/dhcp/dhclient-enter-hooks.d/resolvconf 1.82ubuntu1~
diff --git a/debian/resolvconf.resolvconf-pull-resolved.path b/debian/resolvconf.resolvconf-pull-resolved.path
2deleted file mode 1006443deleted file mode 100644
index 9ccd05e..0000000
--- a/debian/resolvconf.resolvconf-pull-resolved.path
+++ /dev/null
@@ -1,7 +0,0 @@
1[Path]
2PathChanged=/run/systemd/resolve/stub-resolv.conf
3PathExists=/run/systemd/resolve/stub-resolv.conf
4
5[Install]
6WantedBy=systemd-resolved.service
7
diff --git a/debian/resolvconf.resolvconf-pull-resolved.service b/debian/resolvconf.resolvconf-pull-resolved.service
8deleted file mode 1006440deleted file mode 100644
index 109c462..0000000
--- a/debian/resolvconf.resolvconf-pull-resolved.service
+++ /dev/null
@@ -1,7 +0,0 @@
1[Unit]
2ConditionPathExists=/run/resolvconf/enable-updates
3ConditionFileIsExecutable=/sbin/resolvconf
4
5[Service]
6Type=oneshot
7ExecStart=+-/bin/sh -c 'cat /run/systemd/resolve/stub-resolv.conf | grep -v edns0 | /sbin/resolvconf -a systemd-resolved'
diff --git a/debian/rules b/debian/rules
index dbfd316..888537b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,6 +19,5 @@ override_dh_install:
1919
20override_dh_installsystemd:20override_dh_installsystemd:
21 dh_installsystemd21 dh_installsystemd
22 dh_installsystemd --name=resolvconf-pull-resolved
2322
24.PHONY: override_dh_auto_test override_dh_installinit override_dh_install override_dh_installsystemd23.PHONY: override_dh_auto_test override_dh_installinit override_dh_install override_dh_installsystemd
diff --git a/etc/dhcp/dhclient-enter-hooks.d/resolvconf b/etc/dhcp/dhclient-enter-hooks.d/resolvconf
25deleted file mode 10064424deleted file mode 100644
index 72b2be7..0000000
--- a/etc/dhcp/dhclient-enter-hooks.d/resolvconf
+++ /dev/null
@@ -1,81 +0,0 @@
1#
2# Script fragment to make dhclient supply nameserver information to resolvconf
3#
4
5# Tips:
6# * Be careful about changing the environment since this is sourced
7# * This script fragment uses bash features
8# * As of isc-dhcp-client 4.2 the "reason" (for running the script) can be one of the following.
9# (Listed on man page:) MEDIUM(0) PREINIT(0) BOUND(M) RENEW(M) REBIND(M) REBOOT(M) EXPIRE(D) FAIL(D) RELEASE(D) STOP(D) NBI(-) TIMEOUT(M)
10# (Also used in master script:) ARPCHECK(0), ARPSEND(0)
11# (Also used in master script:) PREINIT6(0) BOUND6(M) RENEW6(M) REBIND6(M) DEPREF6(0) EXPIRE6(D) RELEASE6(D) STOP6(D)
12# (0) = master script does not run make_resolv_conf
13# (M) = master script runs make_resolv_conf
14# (D) = master script downs interface
15# (-) = master script does nothing with this
16
17if [ -x /sbin/resolvconf ] ; then
18 # For safety, first undefine the nasty default make_resolv_conf()
19 make_resolv_conf() { : ; }
20 case "$reason" in
21 BOUND|RENEW|REBIND|REBOOT|TIMEOUT)
22 # Define a resolvconf-compatible m_r_c() function
23 # It gets run later (or, in the TIMEOUT case, MAY get run later)
24 make_resolv_conf() {
25 local R
26 local N
27 R=""
28 if [ "$new_domain_name_servers" ] && [ "$new_domain_name" ] ; then
29 R="${R}domain $new_domain_name
30"
31 fi
32 if [ "$new_domain_name_servers" ] && [ "$new_domain_search" ] ; then
33 R="${R}search $new_domain_search
34"
35 fi
36 for N in $new_domain_name_servers ; do
37 R="${R}nameserver $N
38"
39 done
40 [ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.dhclient"
41 }
42 ;;
43 BOUND6|RENEW6|REBIND6)
44 # Define a resolvconf-compatible m_r_c() function
45 # It gets run later (or, in the TIMEOUT case, MAY get run later)
46 make_resolv_conf() {
47 local R
48 local N
49 local N_LOW
50 local ZONE_ID
51 R=""
52 if [ "$new_dhcp6_name_servers" ] && [ "$new_dhcp6_domain_search" ] ; then
53 R="${R}search $new_dhcp6_domain_search
54"
55 fi
56 for N in $new_dhcp6_name_servers ; do
57
58 # If the nameserver has a link-local address
59 # then add a zone ID (interface name) to it.
60 N_LOW="$(echo "$N" | tr '[:upper:]' '[:lower:]')"
61 if expr "$N_LOW" : ^fe80:: >/dev/null ; then
62 ZONE_ID="%$interface"
63 else
64 ZONE_ID=""
65 fi
66 R="${R}nameserver $N$ZONE_ID
67"
68 done
69 [ ! "$interface" ] || echo -n "$R" | /sbin/resolvconf -a "${interface}.ip6.dhclient"
70 }
71 ;;
72 EXPIRE|FAIL|RELEASE|STOP)
73 # Delete resolv.conf info
74 [ ! "$interface" ] || /sbin/resolvconf -d "${interface}.dhclient"
75 ;;
76 EXPIRE6|RELEASE6|STOP6)
77 # Delete resolv.conf info
78 [ ! "$interface" ] || /sbin/resolvconf -d "${interface}.ip6.dhclient"
79 ;;
80 esac
81fi
diff --git a/etc/resolvconf/update.d/libc b/etc/resolvconf/update.d/libc
index 12298c7..c848adc 100755
--- a/etc/resolvconf/update.d/libc
+++ b/etc/resolvconf/update.d/libc
@@ -7,9 +7,6 @@
7#7#
8# This script is part of the resolvconf package.8# This script is part of the resolvconf package.
9#9#
10# Set REPORT_ABSENT_SYMLINK=no to inhibit warning message that
11# /etc/resolv.conf is not a symbolic link
12#
13# Set TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no10# Set TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=no
14# to allow additional nameserver addresses to be listed in11# to allow additional nameserver addresses to be listed in
15# resolv.conf after an initial loopback address 127.* or ::1.12# resolv.conf after an initial loopback address 127.* or ::1.
@@ -32,17 +29,6 @@ TAILFILE="${RESOLVCONFDIR}/tail"
32DYNAMICRSLVCNFFILE="/run/resolvconf/resolv.conf"29DYNAMICRSLVCNFFILE="/run/resolvconf/resolv.conf"
33TMPFILE="${DYNAMICRSLVCNFFILE}_new.$$"30TMPFILE="${DYNAMICRSLVCNFFILE}_new.$$"
3431
35# Set unset variables to their defaults
36if [ -z "$REPORT_ABSENT_SYMLINK" ] ; then
37 # '..._ALTERED_...' is the old deprecated name for this variable
38 if [ "$REPORT_ALTERED_SYMLINK" ] ; then
39 REPORT_ABSENT_SYMLINK="$REPORT_ALTERED_SYMLINK"
40 else
41 # Set to default value
42 REPORT_ABSENT_SYMLINK=y
43 fi
44fi
45
46if [ -z "$TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS" ] ; then32if [ -z "$TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS" ] ; then
47 # '..._127' is the old deprecated name for this variable33 # '..._127' is the old deprecated name for this variable
48 if [ "$TRUNCATE_NAMESERVER_LIST_AFTER_127" ] ; then34 if [ "$TRUNCATE_NAMESERVER_LIST_AFTER_127" ] ; then
@@ -56,18 +42,6 @@ fi
5642
57report_warning() { echo "$0: Warning: $*" >&2 ; }43report_warning() { echo "$0: Warning: $*" >&2 ; }
5844
59resolv_conf_is_symlinked_to_dynamic_file() {
60 [ -L ${ETC}/resolv.conf ] && [ "$(readlink -m ${ETC}/resolv.conf)" = "$DYNAMICRSLVCNFFILE" ]
61}
62
63if ! resolv_conf_is_symlinked_to_dynamic_file ; then
64 case "$REPORT_ABSENT_SYMLINK" in
65 y|Y|yes|YES|Yes)
66 report_warning "${ETC}/resolv.conf is not a symbolic link to $DYNAMICRSLVCNFFILE"
67 ;;
68 esac
69fi
70
71# Args are candidate items not containing spaces45# Args are candidate items not containing spaces
72# Returns RSLT -- space-separated list of items without duplicates46# Returns RSLT -- space-separated list of items without duplicates
73#47#
@@ -131,31 +105,19 @@ clean_up
131105
132### Make the file ###106### Make the file ###
133: > "$TMPFILE"107: > "$TMPFILE"
134[ -f "$HEADFILE" ] && cat "$HEADFILE" >> "$TMPFILE"108cat <<EOF >"$TMPFILE"
135for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMPFILE" ; done109[Resolve]
136[ "$SRCHS" ] && echo "search $SRCHS" >> "$TMPFILE"110DNS=$NMSRVRS
137[ "$RSLVCNFFILES" ] && sed -e '/^[[:space:]]*$/d' -e '/^[[:space:]]*#/d' -e '/^[[:space:]]*\(\(nameserver\)\|\(search\)\|\(domain\)\)[[:space:]]/d' $RSLVCNFFILES >> "$TMPFILE" 2>/dev/null111EOF
138[ -f "$TAILFILE" ] && cat "$TAILFILE" >> "$TMPFILE"
139
140### Put the file in place ###
141
142if [ -f "$DYNAMICRSLVCNFFILE" ] && [ "$(cat $TMPFILE)" = "$(cat $DYNAMICRSLVCNFFILE)" ] ; then
143 # The file has not changed
144 rm -f "$TMPFILE"
145 exit 0
146fi
147
148# The file has changed
149mv -f "$TMPFILE" "$DYNAMICRSLVCNFFILE"
150112
151# Only notify users of /etc/resolv.conf if /etc/resolv.conf is actually113[ "$SRCHS" ] && echo "DNS=$SRCHS" >> "$TMPFILE"
152# symlinked to the file we have just updated.
153resolv_conf_is_symlinked_to_dynamic_file || exit 0
154114
155# Notify users of the resolver115### Put the file in place ###
156if [ -d "${ETCRESOLVCONF}/update-libc.d" ] ; then116statedir=/run/systemd/resolved.conf.d
157 exec run-parts "${ETCRESOLVCONF}/update-libc.d"117mkdir -p "$statedir"
118mv -f "$TMPFILE" "$statedir/resolvconf.conf"
119if systemctl --quiet is-active systemd-resolved; then
120 systemctl restart systemd-resolved
158fi121fi
159122
160exit 0123exit 0
161

Subscribers

People subscribed via source and target branches