FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-26-2012, 08:35 AM
Willie WY Wong
 
Default Why is dhcpcd starting by itself?

On Thursday night, I emerged some packages

Thu Feb 23 23:26:44 2012 >>> net-libs/webkit-gtk-1.6.3-r300
Thu Feb 23 23:29:44 2012 >>> www-client/midori-0.4.3
Thu Feb 23 23:45:36 2012 >>> sys-apps/portage-2.1.10.49
Thu Feb 23 23:52:50 2012 >>> media-libs/libpng-1.5.9
Thu Feb 23 23:53:45 2012 >>> sys-apps/openrc-0.9.9
Thu Feb 23 23:56:43 2012 >>> dev-libs/libgcrypt-1.5.0-r2
Thu Feb 23 23:58:35 2012 >>> media-libs/libmikmod-3.2.0_beta2-r5
Thu Feb 23 23:59:20 2012 >>> media-libs/vo-aacenc-0.1.2
Fri Feb 24 00:00:44 2012 >>> dev-libs/libevent-2.0.17
Fri Feb 24 00:06:11 2012 >>> dev-libs/libxml2-2.7.8-r5
Fri Feb 24 00:07:26 2012 >>> media-sound/alsa-utils-1.0.25-r1
Fri Feb 24 00:08:35 2012 >>> sys-apps/file-5.11
Fri Feb 24 00:10:28 2012 >>> media-libs/imlib2-1.4.5
Fri Feb 24 00:15:00 2012 >>> sys-apps/util-linux-2.20.1-r2
Fri Feb 24 00:15:18 2012 >>> dev-util/intltool-0.50.1
Fri Feb 24 00:19:57 2012 >>> net-print/hplip-3.12.2-r1
Fri Feb 24 00:23:30 2012 >>> media-sound/mpd-0.16.7
Fri Feb 24 00:23:47 2012 >>> dev-tex/latexmk-430a
Fri Feb 24 00:24:20 2012 >>> dev-tex/latex-beamer-3.13

On Friday morning, I started having network problems. wicd would try
to connect to the access point, and fail.

[ 49.754744] r8169 0000:01:00.0: eth0: link down
[ 50.958354] r8169 0000:01:00.0: eth0: link down
[ 52.349167] wlan0: authenticate with 00:01:e3:4b:4a:6d (try 1)
[ 52.355694] wlan0: authenticated
[ 52.355762] wlan0: associate with 00:01:e3:4b:4a:6d (try 1)
[ 52.358116] wlan0: RX AssocResp from 00:01:e3:4b:4a:6d (capab=0x411 status=0 aid=6)
[ 52.358130] wlan0: associated
[ 58.579496] wlan0: deauthenticating from 00:01:e3:4b:4a:6d by local choice (reason=3)
[ 58.589726] cfg80211: Calling CRDA to update world regulatory domain
[ 58.751572] r8169 0000:01:00.0: eth0: link down
[ 59.954878] r8169 0000:01:00.0: eth0: link down
[ 61.359184] wlan0: authenticate with 00:01:e3:4b:4a:6d (try 1)
[ 61.365490] wlan0: authenticated
[ 61.365561] wlan0: associate with 00:01:e3:4b:4a:6d (try 1)
[ 61.367884] wlan0: RX AssocResp from 00:01:e3:4b:4a:6d (capab=0x411 status=0 aid=6)
[ 61.367898] wlan0: associated
[ 65.108874] wlan0: deauthenticating from 00:01:e3:4b:4a:6d by local choice (reason=3)
[ 65.119716] cfg80211: Calling CRDA to update world regulatory domain
[ 65.295639] r8169 0000:01:00.0: eth0: link down
[ 262.492240] r8169 0000:01:00.0: eth0: link down

A bit of tracking plus memories of bygone days led me to realise that,
for some reason, the two copies of dhcpcd client were being run! One
was started by wicd, after it associates to the AP. But how'bout the
other one?

Well, on boot up this morning, I saw that, for the first time in a
*very long while* that DHCPCD is being started at boot time as a
service. Now, I am sure I didn't include it as a service.

Gee-Mi-Ni ~ # rc-update show
alsasound | default
bootmisc | boot
consolefont | boot
dbus | default
devfs | sysinit
dmesg | sysinit
fsck | boot
gpm | default
hostname | boot
hwclock | boot
keymaps | boot
killprocs | shutdown
local | default nonetwork
localmount | boot
metalog | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.lo | boot
netmount | default
procfs | boot
root | boot
savecache | shutdown
swap | boot
swapfiles | boot
sysctl | boot
termencoding | boot
udev | sysinit
udev-postmount | default
urandom | boot
wicd | boot

Okay, on the other hand rc-status showed something I haven't seen before

Dynamic Runlevel: needed
sysfs [started]
dhcpcd [started]

Huh, simple enough, some other service needs dhcpcd to be running. Okay. Let me
see which one it is:

Gee-Mi-Ni init.d # grep dhcpcd /etc/init.d/*
/etc/init.d/dhcpcd:command=/sbin/dhcpcd
/etc/init.d/dhcpcdidfile=/var/run/dhcpcd.pid
/etc/init.d/wpa_supplicant: before dns dhcpcd net

uh, apparently none of them?

Can someone help me figure out how to find the offending initscript that is
needlessly calling dhcpcd?

Cheers,
W
--
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire
et vice versa ~~~ I. Newton
 
Old 02-26-2012, 12:32 PM
Dale
 
Default Why is dhcpcd starting by itself?

Willie WY Wong wrote:
> On Thursday night, I emerged some packages
>
<< SNIP >>
> Can someone help me figure out how to find the offending initscript that is
> needlessly calling dhcpcd?
>
> Cheers,
> W



This may not be it but worth taking a look at. /etc/rc.conf From that
file:

# rc_hotplug is a list of services that we allow to be hotplugged.
# By default we do not allow hotplugging.
# A hotplugged service is one started by a dynamic dev manager when a
matching
# hardware device is found.
# This service is intrinsically included in the boot runlevel.
# To disable services, prefix with a !
# Example - rc_hotplug="net.wlan !net.*"
# This allows net.wlan and any service not matching net.* to be plugged.
# Example - rc_hotplug="*"
# This allows all services to be hotplugged
#rc_hotplug="*"

I think that should be off by default but maybe try disabling them all
manually just in case.

Dale

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 02-26-2012, 12:35 PM
walt
 
Default Why is dhcpcd starting by itself?

On 02/26/2012 01:35 AM, Willie WY Wong wrote:

> Gee-Mi-Ni init.d # grep dhcpcd /etc/init.d/*
> /etc/init.d/dhcpcd:command=/sbin/dhcpcd
> /etc/init.d/dhcpcdidfile=/var/run/dhcpcd.pid
> /etc/init.d/wpa_supplicant: before dns dhcpcd net
>
> uh, apparently none of them?

The net.lo script does include this test:

# Ensure that loopback has the correct address
if [ "${IFACE}" = "lo" -o "${IFACE}" = "lo0" ]; then
if [ "$1" != "null" ]; then
config_0="127.0.0.1/8"
config_index=1
fi
else
if [ -z "$1" ]; then
ewarn "No configuration specified; defaulting to DHCP"
config_0="dhcp"
config_index=1
fi
fi

The value of ${IFACE} is set (I think) by looking at the ".lo"
or ".eth0" file extension of net.lo or net.eth0 (or whatever
symlink you created when you installed gentoo). If you don't
have a net.whatever symlink to net.lo, then openrc defaults to
dhcp.

Do you maybe not have a net.foo symlink, or an old obsolete one
in /etc/init.d ?
 
Old 02-26-2012, 12:45 PM
Willie WY Wong
 
Default Why is dhcpcd starting by itself?

On Sun, Feb 26, 2012 at 07:32:43AM -0600, Penguin Lover Dale squawked:
> This may not be it but worth taking a look at. /etc/rc.conf From that
> file:
>
> # rc_hotplug is a list of services that we allow to be hotplugged.
> # By default we do not allow hotplugging.
> # A hotplugged service is one started by a dynamic dev manager when a
> matching
> # hardware device is found.
> # This service is intrinsically included in the boot runlevel.
> # To disable services, prefix with a !
> # Example - rc_hotplug="net.wlan !net.*"
> # This allows net.wlan and any service not matching net.* to be plugged.
> # Example - rc_hotplug="*"
> # This allows all services to be hotplugged
> #rc_hotplug="*"
>
> I think that should be off by default but maybe try disabling them all
> manually just in case.
>

Hotplug has never been turned on in my case.

I've always had

rc_hotplug="!net.*"

W
--
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire
et vice versa ~~~ I. Newton
 
Old 02-26-2012, 01:17 PM
Willie WY Wong
 
Default Why is dhcpcd starting by itself?

On Sun, Feb 26, 2012 at 05:35:30AM -0800, Penguin Lover walt squawked:
> The value of ${IFACE} is set (I think) by looking at the ".lo"
> or ".eth0" file extension of net.lo or net.eth0 (or whatever
> symlink you created when you installed gentoo). If you don't
> have a net.whatever symlink to net.lo, then openrc defaults to
> dhcp.

Gee-Mi-Ni init.d # ls -l net*
lrwxrwxrwx 1 root root 6 Nov 7 2009 net.eth0 -> net.lo
-rwxr-xr-x 1 root root 16852 Feb 26 10:06 net.lo
-rwxr-xr-x 1 root root 2211 Feb 26 10:06 netmount
lrwxrwxrwx 1 root root 6 Jan 22 2010 net.wlan0 -> net.lo
-rwxr-xr-x 1 root root 6954 Feb 26 10:06 network

I think I have the correct ones.

W
--
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire
et vice versa ~~~ I. Newton
 
Old 02-26-2012, 01:19 PM
Willie WY Wong
 
Default Why is dhcpcd starting by itself?

On Sun, Feb 26, 2012 at 10:35:35AM +0100, Penguin Lover Willie WY Wong squawked:
> Can someone help me figure out how to find the offending initscript that is
> needlessly calling dhcpcd?

Apparently the culprit is /etc/init.d/netmount
I am not sure how it got into the default run level, since I don't use
any network file systems on my netbook.

Cheers,
W
--
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire
et vice versa ~~~ I. Newton
 
Old 02-26-2012, 02:31 PM
Alan McKinnon
 
Default Why is dhcpcd starting by itself?

On Sun, 26 Feb 2012 15:19:54 +0100
Willie WY Wong <wongwwy@member.ams.org> wrote:

> On Sun, Feb 26, 2012 at 10:35:35AM +0100, Penguin Lover Willie WY
> Wong squawked:
> > Can someone help me figure out how to find the offending initscript
> > that is needlessly calling dhcpcd?
>
> Apparently the culprit is /etc/init.d/netmount
> I am not sure how it got into the default run level, since I don't use
> any network file systems on my netbook.

I believe the problem is much deeper than that and while your
observations are valid, you don't have a root cause yet. You just have
a happy symptom that works with your specific configuration.

Here's what I've found after much up & down-grading and rebooting:

First, I've had netmount in the default runlevel for ages and it's
worked for ages even though it does nothing.
Second, openrc has been launching "dhcpcd -q" at boot time for ages and
this has never interfered with wicd which comes along later.

openrc-0.8.* always works with any kernel version
openrc-0.9* work with kernel-3.2.5

openrc-0.9* does not work with kernel-3.2.6, giving these errors:

Feb 26 17:16:53 khamul dhcpcd[2661]: wlan0: leased 172.20.0.41 for
43200 seconds
Feb 26 17:16:53 khamul avahi-daemon[2479]: Joining mDNS multicast group
on interface wlan0.IPv4 with address 172.20.0.41.
Feb 26 17:16:53 khamul avahi-daemon[2479]: New relevant interface
wlan0.IPv4 for mDNS.
Feb 26 17:16:53 khamul avahi-daemon[2479]: Registering new address
record for 172.20.0.41 on wlan0.IPv4.
Feb 26 17:16:54 khamul dhcpcd[2661]: eth0: sending IPv6 Router
Solicitation
Feb 26 17:16:54 khamul dhcpcd[2661]: eth0: sendmsg: Network is
unreachable
Feb 26 17:16:55 khamul dhcpcd[4388]: sending commands to master dhcpcd
process
Feb 26 17:16:55 khamul dhcpcd[2661]: control command: /sbin/dhcpcd -k
wlan0
Feb 26 17:16:55 khamul dhcpcd[2661]: wlan0: releasing lease of
172.20.0.41
Feb 26 17:16:55 khamul avahi-daemon[2479]: Withdrawing address record
for 172.20.0.41 on wlan0.
Feb 26 17:16:55 khamul avahi-daemon[2479]: Leaving mDNS multicast group
on interface wlan0.IPv4 with address 172.20.0.41.
Feb 26 17:16:55 khamul avahi-daemon[2479]: Interface wlan0.IPv4 no
longer relevant for mDNS.
Feb 26 17:16:55 khamul dhcpcd[2661]: wlan0: open_udp_socket: Cannot
assign requested address
Feb 26 17:16:55 khamul kernel: [ 58.240866] wlan0: deauthenticating
from 00:04:ed:45:65:df by local choice (reason=3)

That looks to me like avahi is all confused and tripping over what
openrc & wicd do properly. I'd say the root cause is a change in
kernel-3.2.6 that was not tested against.

So, what's the next debugging step?


--
Alan McKinnnon
alan.mckinnon@gmail.com
 
Old 02-26-2012, 03:28 PM
walt
 
Default Why is dhcpcd starting by itself?

On 02/26/2012 06:17 AM, Willie WY Wong wrote:
> On Sun, Feb 26, 2012 at 05:35:30AM -0800, Penguin Lover walt squawked:
>> The value of ${IFACE} is set (I think) by looking at the ".lo"
>> or ".eth0" file extension of net.lo or net.eth0 (or whatever
>> symlink you created when you installed gentoo). If you don't
>> have a net.whatever symlink to net.lo, then openrc defaults to
>> dhcp.
>
> Gee-Mi-Ni init.d # ls -l net*
> lrwxrwxrwx 1 root root 6 Nov 7 2009 net.eth0 -> net.lo
> -rwxr-xr-x 1 root root 16852 Feb 26 10:06 net.lo
> -rwxr-xr-x 1 root root 2211 Feb 26 10:06 netmount
> lrwxrwxrwx 1 root root 6 Jan 22 2010 net.wlan0 -> net.lo
> -rwxr-xr-x 1 root root 6954 Feb 26 10:06 network
>
> I think I have the correct ones.

Yes, that looks okay. My other thought is about the contents of
/etc/conf.d/net. IIRC there was some confusion about the proper
syntax of that file concerning the use of parentheses and quote
marks, and I believe the syntax did change at least once.

You could check your current syntax against the most recently
installed /usr/share/doc/openrc*/net.example.bz2.
 
Old 02-26-2012, 03:52 PM
Dan Johansson
 
Default Why is dhcpcd starting by itself?

On Sunday 26 February 2012 15.19:54 Willie WY Wong wrote:
> On Sun, Feb 26, 2012 at 10:35:35AM +0100, Penguin Lover Willie WY Wong squawked:
> > Can someone help me figure out how to find the offending initscript that is
> > needlessly calling dhcpcd?
>
> Apparently the culprit is /etc/init.d/netmount
> I am not sure how it got into the default run level, since I don't use
> any network file systems on my netbook.

And on my laptop the culprit seems to be /etc/init.d/sshd

--
Dan Johansson, <http://www.dmj.nu>
************************************************** *
This message is printed on 100% recycled electrons!
************************************************** *
 
Old 02-26-2012, 03:57 PM
Dan Johansson
 
Default Why is dhcpcd starting by itself?

On Sunday 26 February 2012 17.52:13 Dan Johansson wrote:
> On Sunday 26 February 2012 15.19:54 Willie WY Wong wrote:
> > On Sun, Feb 26, 2012 at 10:35:35AM +0100, Penguin Lover Willie WY Wong squawked:
> > > Can someone help me figure out how to find the offending initscript that is
> > > needlessly calling dhcpcd?
> >
> > Apparently the culprit is /etc/init.d/netmount
> > I am not sure how it got into the default run level, since I don't use
> > any network file systems on my netbook.
>
> And on my laptop the culprit seems to be /etc/init.d/sshd

At the moment I have solved it with putting "rc_dhcpcd_provide="!net"" in /etc/rc.conf
which prevents dhcpcd to start when sshd is started.

--
Dan Johansson, <http://www.dmj.nu>
************************************************** *
This message is printed on 100% recycled electrons!
************************************************** *
 

Thread Tools




All times are GMT. The time now is 10:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org