Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 164516
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Christian Faulhammer <fauli@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Antti Mäkelä <zarhan@iki.fi>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 164516 depends on: 201853 Show dependency tree
Bug 164516 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-01-30 09:59 0000
If an application destroys the 

lrwxrwxrwx 1 root root  26 Jan 30 10:32 resolv.conf ->
resolvconf/run/resolv.conf

link, resolvconf does not recover from this. The link has to be manually
re-created (ln -s resolvconf/run/resolv.conf) or DNS resolving does not work
with any subsequent reboots or even when roaming from a wireless LAN to
another.

This is apparently due to the following in /etc/resolvconf/update.d/libc:

[[ $(readlink /etc/resolv.conf 2>/dev/null) \
        != "resolvconf/run/resolv.conf" ]] && exit 0

So it's just an "exit 0" without any possibility to recover.

Anyway, my beef, specifically is with Cisco's vpn client
(net-misc/cisco-vpnclient-3des). When I activate the VPN, this happens in /etc:

etc # ls -l res*
-rw-r--r-- 1 root root  34 Oct 12 15:08 reslisarc
-rw-r--r-- 1 root users 76 Jan 30 11:29 resolv.conf
lrwxrwxrwx 1 root root  26 Jan 30 10:32 resolv.conf.vpnbackup ->
resolvconf/run/resolv.conf

If the VPN connection is terminated *gracefully* the client restores the
original resolv.conf and nothing much happens. 

If stuff goes wrong, such as the WLAN (or PPP) interface suddendly going down
the backup is not restored. I've actually had a kernel panic once when an
interface went down. Granted, this kinds of ungraceful exiting is a
Cisco-specific problem.

Anyway, I'm not sure if this resolv.conf-issue is something that only appears
with Cisco-vpn, or is the scope wider (other VPN packages?). If not, the
problem may be addressed with the ciscovpn-ebuild (if feasible). However, I'd
still like to have some sort of recovery feature for this. Maybe some sort of
RC option "FORCE_RESOLVCONF=1" or something that would *always* recreate the
link and overwrite whatever is going on in there. 

However, just overwriting is not always an option. If I have a VPN connection
and the files that are active are as above (backup and VPN-client-written
resolv.conf), what happens when DHCP (on the underlying logical interface)
renews the lease? The DNS information received from the VPN tunnel by the
client is overwritten with the underlying iface's (eth0 or something) DNS
information...

Anyway, Cc's set to people who I think are responsible for Ciscovpn package and
resolvconf. Hopefully this gets resolved sometime.

------- Comment #1 From Roy Marples (RETIRED) 2007-01-30 14:34:31 0000 -------
(In reply to comment #0)
> If an application destroys the 
> 
> lrwxrwxrwx 1 root root  26 Jan 30 10:32 resolv.conf ->
> resolvconf/run/resolv.conf
> 
> link, resolvconf does not recover from this. The link has to be manually
> re-created (ln -s resolvconf/run/resolv.conf) or DNS resolving does not work
> with any subsequent reboots or even when roaming from a wireless LAN to
> another.
> 
> This is apparently due to the following in /etc/resolvconf/update.d/libc:
> 
> [[ $(readlink /etc/resolv.conf 2>/dev/null) \
>         != "resolvconf/run/resolv.conf" ]] && exit 0
> 
> So it's just an "exit 0" without any possibility to recover.

This is behaviour by design - if resolvconf isn't controlling /etc/resolv.conf
then it won't do anything with the libc update script. Instead, each package
should use resolvconf when available.

Packages converted to use resolvconf
baselayout
dhcpcd
dhclient
udhcpc
pump
openvpn

> However, just overwriting is not always an option. If I have a VPN connection
> and the files that are active are as above (backup and VPN-client-written
> resolv.conf), what happens when DHCP (on the underlying logical interface)
> renews the lease? The DNS information received from the VPN tunnel by the
> client is overwritten with the underlying iface's (eth0 or something) DNS
> information...

Exactly. Forcing a recreation of the link in resolvconf is pointless if
resolvconf isn't used by everything in the chain.

http://www.fmepnet.org/debian_vpnc.html
Shows that Debian can use vpnc with resolvconf, so it can be done.

Reassigning as vpnc will have to be fixed, not resolvconf.

------- Comment #2 From Antti Mäkelä 2007-01-30 15:02:26 0000 -------
(In reply to comment #1)
> This is behaviour by design - if resolvconf isn't controlling /etc/resolv.conf
> then it won't do anything with the libc update script. Instead, each package
> should use resolvconf when available.

  How about still creating the symlink, at least during boot, maybe in bootmisc
or net.lo, even if not touching it later? 

  (Namely addressing the crash recovery thing...situations where resolvconf
isn't controlling /etc/resolv.conf but so is nothing else, either... - so
system should fall back to resolvconf. If at no other time, at least upon
reboot it should be safe to assume that nothing else is controlling
/etc/resolv.conf.)

  Hopefully the vpnc-specific stuff gets addressed too.

------- Comment #3 From Chris Gianelloni (RETIRED) 2007-01-31 15:17:05 0000 -------
Umm... vpnc != cisco-vpnclient-3des (which is not open source)...

There's absolutely nothing I can do for the cisco-vpnclient-3des package, which
is the only thing I maintain.  While vpnc can be used to connect to Cisco VPN
Concentrators (and PIX, etc), I don't have anything to do with that package.

------- Comment #4 From Roy Marples (RETIRED) 2007-01-31 16:55:58 0000 -------
We can't fix closed source stuff, but we can work with vpnc then.

Hanno, Debian support vpnc with resolvconf, so I suggest you grab their patch.

------- Comment #5 From Antti Mäkelä 2007-01-31 21:35:12 0000 -------
Drat. I could switch to vpnc if it would work for me. However, according to
vpnc homepage, it does not support certificates, which makes it kinda useless
in any real environment (pre-shared keys are not really used in enterprise
deployments - you kinda need to be able to at least authenticate the
concentrator.). 

Oh well, I guess I'm stuck with Cisco - which kinda brings me back to comment
#2 - could resolvconf somehow detect or at least assume in certain situations
(such as during boot) that while resolvconf does not apparently control
/etc/resolv.conf at the time due to bad or missing symlink, neither does
anything else (since system is just starting up!). 

Oh well, I guess I'll just add the symlink creation/overwrite to local.start
for the time being.

------- Comment #6 From Roy Marples (RETIRED) 2007-12-10 13:59:43 0000 -------
Ebuild on bug #201853 fixes this.

------- Comment #7 From Christian Faulhammer 2008-06-03 16:09:33 0000 -------
Do the hook scripts for vpnc not solve your problem?  One can call resolvonf -u
from there.

------- Comment #8 From Antti Mäkelä 2008-08-30 08:17:00 0000 -------
(In reply to comment #7)
> Do the hook scripts for vpnc not solve your problem?  One can call resolvonf -u
> from there.

  Not really since cisco-vpnclient just alters resolv.conf without allowing any
hooking. Anyway, fix in bug #228001 works for me.

------- Comment #9 From Christian Faulhammer 2008-09-02 21:21:33 0000 -------
Closing this one, too.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug