[Bug 1085849] Re: Please don't change the answer to linkify-resolvconf
Thomas Hood
1085849 at bugs.launchpad.net
Tue Feb 12 11:39:08 UTC 2013
Something like the following. Then Ubuntu just has to uncomment the
indicated line and comment the line before it.
diff --git a/debian/postinst b/debian/postinst
index 2b4faf7..3822ece 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -113,9 +113,13 @@ case "$1" in
fi
# Linkify /etc/resolv.conf if appropriate
+ if [ "$DEBCONF_RECONFIGURE" = 1 ] || [ "$1" = reconfigure ] ; then
+ rm -f /etc/resolvconf/already-linkified-resolvconf
+ fi
db_get resolvconf/linkify-resolvconf
if
[ "$RET" = "true" ]
+#Ubuntu: [ "$RET" = "true" ] && [ ! -e /etc/resolvconf/already-linkified-resolvconf ]
then
if is_immutable_file /etc/resolv.conf ; then
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
@@ -148,6 +152,19 @@ case "$1" in
fi
# Create the link
ln -nsf /etc/resolvconf/run/resolv.conf /etc/resolv.conf
+ # Make a record that we have created it
+ echo "This is a flag file whose presence indicates that
+the resolvconf package has already created a symbolic link
+at /etc/resolv.conf and should not do so again.
+
+If you remove this file then the resolvconf package will
+create the symbolic link again the next time the package
+is upgraded, provided of course the linkify-resolvconf
+debconf question has an affirmative answer.
+
+If the administrator runs 'dpkg-reconfigure resolvconf'
+then this file is deleted so that the package can make
+another attempt to create the symbolic link." > /etc/resolvconf/already-linkified-resolvconf
fi
fi
;;
--
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/1085849
Title:
Please don't change the answer to linkify-resolvconf
Status in “resolvconf” package in Ubuntu:
New
Bug description:
Resolvconf postinst does this:
db_get resolvconf/linkify-resolvconf
if [ "$RET" = "true" ] ; then
[...]
# Create the link and make sure we don't convert it again on upgrade
[...]
ln -nsf ../run/resolvconf/resolv.conf /etc/resolv.conf
db_set resolvconf/linkify-resolvconf false
fi
The problem with the last line is that it obliterates the original
answer to the question, which makes debugging more difficult. This is
a non-trivial drawback in connection with bug #1000244 .
We could achieve the same result without the aforementioned drawback
if we used an additional debconf question to store the information
that we have made at least one attempt to linkify. Roughly:
db_get resolvconf/linkify-resolvconf
if [ "$RET" = "true" ] ; then
[...]
db_get resolvconf/already-linkified-resolvconf
if [ "$RET" != "true" ] ; then
ln -nsf ...
db_set resolvconf/already-linkified-resolvconf true
fi
fi
The additional debconf question would not be presented to the user and
would default to "false". (I am waiving here the more philosophical
objections that may be brought against the use of debconf as a
registry. :)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1085849/+subscriptions
More information about the foundations-bugs
mailing list