On 2015-01-13 20:47:56 +0100, Thomas Hood wrote:
> Hi there and thanks for the report.
>
> First I need some info.
>
> 1. When (if ever) does wicd modify dhclient.conf?
In the past, wicd was creating its own dhclient.conf and was
invoking dhclient with this config file:
2011/12/17 03:16:46 :: /sbin/dhclient -v -cf /var/lib/wicd/dhclient.conf wlan0
Though this is still the way it should work according to the
documentation, this is no longer the case; wicd just executes:
/sbin/dhclient -v wlan0
so that /etc/dhcp/dhclient.conf is used by dhclient (but it has not
been modified by wicd). Well, this is what happens on my machine.
BTW, this was the first confusing point concerning this bug.
> 2. When the malfunction occurs are the contents
> /run/resolvconf/resolv.conf correct (i.e., what one would expect to
> find in resolv.conf)?
Yes, it appears to be correct.
> So that the problem is that /etc/resolv.conf is not a symbolic link
> to /run/resolvconf/resolv.conf?
More or less. The problem is actually a lack of consistency: only
/run/resolvconf/resolv.conf is modified *but* it is not used.
IMHO, there would be two possible correct behaviors concerning
the /etc/dhcp/dhclient-enter-hooks.d/resolvconf hook script:
1. The hook script assumes that resolvconf should be used, so that
a) it should disable the default behavior;
b) it should modify /run/resolvconf/resolv.conf;
c) it should make sure that /etc/resolv.conf is a symlink to
/etc/resolvconf/run/resolv.conf (e.g. by removing the old
file if there is one and adding the symlink).
Currently, the hook script does (a)[*] and (b), but not (c).
[*] make_resolv_conf() { : ; }
2. The hook script assumes that the symlink is not there because
the user didn't want to use resolvconf (without having to remove
the resolvconf package), e.g. temporarily, so that
a) it should test whether /etc/resolv.conf is a symlink to
/etc/resolvconf/run/resolv.conf;
b) if it isn't, terminate;
c) otherwise the script should disable the default behavior
and modify /run/resolvconf/resolv.conf (this is what it
currently does).
Here, what is missing is the test (a). I suppose that changing
the line
if [ -x /sbin/resolvconf ] ; then
to
if [ -x /sbin/resolvconf ] && \
[ "$(readlink /etc/resolv.conf)" = /etc/resolvconf/run/resolv.conf ] ; then
would be sufficient.
On 2015-01-13 22:45:45 +0100, Axel Beckert wrote:
[wicd]
> But it doesn't use /etc/dhcp/dhclient.conf for that (probably because
> it should also work when using static IPs) but (without having
> resolvconf installed) modifies /etc/resolv.conf directly as it seems.
On my machine, it doesn't. In the wicd-daemon source, the only parts
related to /etc/resolv.conf are:
def main(argv):
""" The main daemon program.
Keyword arguments:
argv -- The arguments passed to the script.
"""
# back up resolv.conf before we do anything else
try:
backup_location = wpath.varlib + 'resolv.conf.orig'
# don't back up if .orig exists, probably there cause
# wicd exploded
if not os.path.exists(backup_location):
if os.path.islink('/etc/resolv.conf'):
dest = os.readlink('/etc/resolv.conf')
os.symlink(dest, backup_location)
else:
shutil.copy2('/etc/resolv.conf', backup_location)
os.chmod(backup_location, 0644)
except IOError:
print 'error backing up resolv.conf'
and
if kill:
try:
f = open(wpath.pidfile)
except:
#print >> sys.stderr, "No wicd instance active, aborting."
sys.exit(1)
# restore resolv.conf on quit
try:
backup_location = wpath.varlib + 'resolv.conf.orig'
if os.path.islink(backup_location):
dest = os.readlink(backup_location)
os.remove('/etc/resolv.conf')
os.symlink(dest, '/etc/resolv.conf')
else:
shutil.move(backup_location, '/etc/resolv.conf')
os.chmod('/etc/resolv.conf', 0644)
except IOError:
print 'error restoring resolv.conf'
and indeed, there is a backup file:
-rw-r--r-- 1 root root 21 2010-05-24 20:28:15 /var/lib/wicd/resolv.conf.orig
However it is completely obsolete. The above method is obviously
broken: if ever wicd-daemon or the system crashes, or the machine
switches off due to a power supply problem, then one ends up with
an obsolete backup file, and the backup no longer works at all
until this file is removed by the user (who probably doesn't know
anything about this problem).
> At least for a short moment the message "Modifying /etc/resolv.conf"
> or similar was shown in wicd-curses' status line.
Are you sure that this comes from wicd? The wicd source doesn't
contain the word "Modifying".
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]