# ifplugd not doing dhcp?

## afabco

hey folks,

I have a laptop I'm trying to set up ifplugd on.  I'm starting slow, just using the onboard wired ethernet connector (a natsemi something or other) for right now.

Everything seems to boot fine (so far), except it won't automatically grab in ip.  When I do it manually

# dhcpcd eth0

 grabs an ip just fine.

Details that I could think of are below.  Any ideas?  Anything obviously wrong?  If there's something else I need to post, just let me know. 

Thanks in advance!

I'm using:

baselayout-1.9.4-r6

udev-045

ifplugd-0.26

--------------------------------------------------------------------

/etc/conf.d/net:

root@laptop root # cat /etc/conf.d/net

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

iface_eth1="dhcp"

iface_ath0="dhcp"

#iface_ath0="207.101.201.215 netmask 255.255.255.128"

#dhcpcd_eth0="..."

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"

#gateway="eth0/192.168.1.1"

-----------------------------------------------------

/etc/conf.d/ifplugd:

root@laptop root # cat /etc/conf.d/ifplugd

# -*-sh-*-

# $Id: gentoo-ifplugd-conf-v3,v 1.1 2003/11/15 16:47:58 wmertens Exp $

# This file is part of ifplugd.

#

# ifplugd is free software; you can redistribute it and/or modify it under

# the terms of the GNU General Public License as published by the Free

# Software Foundation; either version 2 of the License, or (at your

# option) any later version.

#

# ifplugd is distributed in the hope that it will be useful, but WITHOUT

# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or

# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License

# for more details.

#

# You should have received a copy of the GNU General Public License

# along with ifplugd; if not, write to the Free Software Foundation,

# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

# ifplugd configuration file

# Please note that this is a bourne shell fragment sourced by the

# init script of ifplugd.

# Specify the interfaces to control here, separated by spaces.

# Ifplugd processes will be started for each of these interfaces when

# the ifplugd init script is called with the "start" argument. You may

# use the magic string "auto" to make the init script start or stop

# ifplugd processes for ALL eth and wlan interfaces that are available

# according to /proc/net/dev. Note that the list of interfaces

# appearing in /proc/net/dev may depend on which kernel modules you

# have loaded.

INTERFACES="eth0"

# Additional parameters for ifplugd.

# See manual page ifplugd.8 for details.

# If you set AUTO to yes, you have to read https://bugs.gentoo.org/show_bug.cgi?id=28362

# I recommend a delay of 0, both ways, since then, you can swap ethernet

# cables on different networks and get a new ip address.

# None of the programs I tested had a problem with the interface being

# gone in the mean time.

AUTO="no"

BEEP="yes"

IGNORE_FAIL="yes"

IGNORE_FAIL_POSITIVE="no"

IGNORE_RETVAL="yes"

POLL_TIME="1"

DELAY_UP="0"

DELAY_DOWN="0"

API_MODE="auto"

SHUTDOWN="yes"

WAIT_ON_FORK="no"

MONITOR="no"

ARGS=""

# Additional parameters for ifplugd for the specified interface. Note that

# the global variable is ignored, when a variable like this is set for an

# interface

# MONITOR_wlan0="yes"

# DELAY_UP_wlan0="5"

# DELAY_DOWN_wlan0="5"

ls /etc/init.d:

root@laptop root # ls -la /etc/init.d

total 377

drwxr-xr-x   2 root root  1976 Jan 25 02:20 .

drwxr-xr-x  87 root root  7824 Jan 25 02:23 ..

-rwxr-xr-x   1 root root   665 Feb 27  2004 acpid

-rwxr-xr-x   1 root root  6599 Dec 11 10:32 alsasound

-rwxr-xr-x   1 root root  2494 Nov 11 02:40 apache2

-rwxr-xr-x   1 root root   548 Feb 24  2004 atd

-rwxr-xr-x   1 root root  3097 Jan 19 22:36 bcrypt

-rwxr-xr-x   1 root root  2808 Jan 25 01:52 bootmisc

-rwxr-xr-x   1 root root  5119 Jan 25 01:52 checkfs

-rwxr-xr-x   1 root root  2324 Jan 25 01:52 checkroot

-rwxr-xr-x   1 root root  1962 Jan 25 01:52 clock

-rwxr-xr-x   1 root root  1918 Jan 25 01:52 consolefont

-rwxr-xr-x   1 root root  1143 Jan 25 01:52 crypto-loop

-rwxr-xr-x   1 root root   515 Jan 19 16:33 cupsd

lrwxrwxrwx   1 root root    21 Jan 25 01:52 depscan.sh -> ../../sbin/depscan.sh

-rwxr-xr-x   1 root root   733 Oct 28 17:22 distccd

-rwxr-xr-x   1 root root  1582 Jan 25 01:52 domainname

-rwxr-xr-x   1 root root   517 Nov 11 03:29 dovecot

-rwxr-xr-x   1 root root   867 Oct 28 20:36 esound

-rwxr-xr-x   1 root root   490 Nov 13 21:43 famd

lrwxrwxrwx   1 root root    23 Jan 25 01:52 functions.sh -> ../../sbin/functions.sh

-rwxr-xr-x   1 root root   591 Oct 28 17:13 gkrellmd

-rwxr-xr-x   1 root root   951 Oct 28 14:17 gpm

-rwxr-xr-x   1 root root  5118 Jan 25 01:52 halt.sh

-rwxr-xr-x   1 root root  2708 Oct 28 21:33 hdparm

-rwxr-xr-x   1 root root  1606 Jan 25 01:52 hostname

-rwxr-xr-x   1 root root  1075 Jan 25 01:58 hotplug

-rwxr-xr-x   1 root root  2661 Jan 25 02:18 ifplugd

-rwxr-xr-x   1 root root  1842 Nov 11 05:04 iptables

-rwxr-xr-x   1 root root  1122 Jan 25 01:52 keymaps

-rwxr-xr-x   1 root root  1131 Nov 27 17:21 kismet

-rwxr-xr-x   1 root root   567 Feb 24  2004 lisa

-rwxr-xr-x   1 root root  2180 Oct 28 17:25 lm_sensors

-rwxr-xr-x   1 root root   727 Jan 25 01:52 local

-rwxr-xr-x   1 root root  1444 Jan 25 01:52 localmount

-rwxr-xr-x   1 root root  2943 Jan 25 01:52 modules

-rwxr-xr-x   1 root root  1187 Jan 24 05:22 mysql

-rwxr-xr-x   1 root root   512 Jan 25 01:52 net.lo

-rwxr-xr-x   1 root root  4414 Jan  6 21:55 net.ppp0

-rwxr-xr-x   1 root root  2520 Jan 25 01:52 netmount

-rwxr-xr-x   1 root root  4753 Feb 25  2004 nfs

-rwxr-xr-x   1 root root  1166 Feb 25  2004 nfsmount

-rwxr-xr-x   1 root root   964 Oct 28 10:32 nscd

-rwxr-xr-x   1 root root   847 Feb 29  2004 ntp-client

-rwxr-xr-x   1 root root   923 Aug 28 22:39 ntpd

-rwxr-xr-x   1 root root   912 Jan 25 01:52 numlock

-rwxr-xr-x   1 root root  2038 Oct 28 21:38 pcmcia

-rwxr-xr-x   1 root root  1132 Dec  9 13:32 portmap

-rwxr-xr-x   1 root root   592 Oct 28 14:54 postfix

-rwxr-xr-x   1 root root   738 Mar  9  2004 proftpd

-rwxr-xr-x   1 root root   237 Jan 25 01:52 reboot.sh

-rwxr-xr-x   1 root root   578 Feb 24  2004 reslisa

-rwxr-xr-x   1 root root   383 Jan 25 01:52 rmnologin

-rwxr-xr-x   1 root root   438 Jan 20 07:15 rsyncd

lrwxrwxrwx   1 root root    23 Jan 25 01:52 runscript.sh -> ../../sbin/runscript.sh

-rwxr-xr-x   1 root root  1090 Jan 23 13:45 samba

-rwxr-xr-x   1 root root  1104 Jan 25 01:52 serial

-rwxr-xr-x   1 root root  1041 Dec  1 06:41 shorewall

-rwxr-xr-x   1 root root   238 Jan 25 01:52 shutdown.sh

-rwxr-xr-x   1 root root   574 Nov  3 22:25 slapd

-rwxr-xr-x   1 root root  2657 Jan  7 00:57 slmodem

-rwxr-xr-x   1 root root   495 Nov  3 22:25 slurpd

-rwxr-xr-x   1 root root   714 Dec  1 05:04 snmpd

-rwxr-xr-x   1 root root  1281 Jan  5 06:19 sshd

-rwxr-xr-x   1 root root   453 Sep 10  2003 switch

-rwxr-xr-x   1 root root  1527 Jan  5 06:13 syslog-ng

-rwxr-xr-x   1 root root   927 Jan 25 01:52 urandom

-rwxr-xr-x   1 root root   541 Feb 24  2004 vixie-cron

-rwxr-xr-x   1 root root  1417 Jan 19 21:44 vmware

-rwxr-xr-x   1 root root   308 Mar 12  2004 webmin

-rw-r--r--   1 root root 16698 May 12  2004 wireless.sh

-rwxr-xr-x   1 root root   975 Jan 20 07:14 wpa_supplicant

-rwxr-xr-x   1 root root  3073 Jan 24 03:43 xdm

-rwxr-xr-x   1 root root  7484 Jan 24 03:43 xfs

-rwxr-xr-x   1 root root 45461 Oct 28 11:50 xprint

-----------------------------------------------------------------------

runlevel boot:

root@laptop root # ls -la /etc/runlevels/boot

total 1

drwxr-xr-x  2 root root 472 Jan 24 02:14 .

drwxr-xr-x  6 root root 152 Sep 10  2003 ..

-rw-r--r--  1 root root   0 Sep 10  2003 .keep

lrwxrwxrwx  1 root root  21 Dec 11 10:33 alsasound -> /etc/init.d/alsasound

lrwxrwxrwx  1 root root  20 Oct 15 01:07 bootmisc -> /etc/init.d/bootmisc

lrwxrwxrwx  1 root root  19 Oct 15 01:07 checkfs -> /etc/init.d/checkfs

lrwxrwxrwx  1 root root  21 Oct 15 01:07 checkroot -> /etc/init.d/checkroot

lrwxrwxrwx  1 root root  17 Oct 15 01:07 clock -> /etc/init.d/clock

lrwxrwxrwx  1 root root  23 Oct 15 01:07 consolefont -> /etc/init.d/consolefont

lrwxrwxrwx  1 root root  20 Oct 15 01:07 hostname -> /etc/init.d/hostname

lrwxrwxrwx  1 root root  19 Oct 15 01:07 hotplug -> /etc/init.d/hotplug

lrwxrwxrwx  1 root root  19 Oct 15 01:07 keymaps -> /etc/init.d/keymaps

lrwxrwxrwx  1 root root  22 Oct 15 01:07 localmount -> /etc/init.d/localmount

lrwxrwxrwx  1 root root  19 Oct 15 01:07 modules -> /etc/init.d/modules

lrwxrwxrwx  1 root root  18 Oct 15 01:07 net.lo -> /etc/init.d/net.lo

lrwxrwxrwx  1 root root  21 Oct 15 01:07 rmnologin -> /etc/init.d/rmnologin

lrwxrwxrwx  1 root root  18 Oct 15 01:07 serial -> /etc/init.d/serial

lrwxrwxrwx  1 root root  19 Oct 15 01:07 urandom -> /etc/init.d/urandom

----------------------------------------------------------

runlevel default:

root@laptop root # ls -la /etc/runlevels/default/

total 1

drwxr-xr-x  2 root root 600 Jan 24 02:15 .

drwxr-xr-x  6 root root 152 Sep 10  2003 ..

-rw-r--r--  1 root root   0 Sep 10  2003 .keep

lrwxrwxrwx  1 root root  19 Oct 15 01:07 Win4Lin -> /etc/init.d/Win4Lin

lrwxrwxrwx  1 root root  17 Oct 15 01:07 acpid -> /etc/init.d/acpid

lrwxrwxrwx  1 root root  19 Oct 15 01:07 apache2 -> /etc/init.d/apache2

lrwxrwxrwx  1 root root  15 Oct 15 01:07 atd -> /etc/init.d/atd

lrwxrwxrwx  1 root root  19 Oct 24 12:16 distccd -> /etc/init.d/distccd

lrwxrwxrwx  1 root root  22 Oct 15 01:07 domainname -> /etc/init.d/domainname

lrwxrwxrwx  1 root root  19 Nov 30 08:59 dovecot -> /etc/init.d/dovecot

lrwxrwxrwx  1 root root  15 Oct 15 01:07 gpm -> /etc/init.d/gpm

lrwxrwxrwx  1 root root  19 Jan 24 01:57 ifplugd -> /etc/init.d/ifplugd

lrwxrwxrwx  1 root root  22 Oct 15 01:07 lm_sensors -> /etc/init.d/lm_sensors

lrwxrwxrwx  1 root root  17 Oct 15 01:07 local -> /etc/init.d/local

lrwxrwxrwx  1 root root  20 Oct 15 01:07 netmount -> /etc/init.d/netmount

lrwxrwxrwx  1 root root  16 Oct 15 01:07 ntpd -> /etc/init.d/ntpd

lrwxrwxrwx  1 root root  18 Oct 15 01:07 pcmcia -> /etc/init.d/pcmcia

lrwxrwxrwx  1 root root  19 Oct 15 01:07 portmap -> /etc/init.d/portmap

lrwxrwxrwx  1 root root  17 Jan 23 13:49 samba -> /etc/init.d/samba

lrwxrwxrwx  1 root root  17 Nov  3 22:26 slapd -> /etc/init.d/slapd

lrwxrwxrwx  1 root root  16 Oct 15 01:07 sshd -> /etc/init.d/sshd

lrwxrwxrwx  1 root root  22 Oct 15 01:07 vixie-cron -> /etc/init.d/vixie-cron

lrwxrwxrwx  1 root root  18 Oct 15 01:07 vmware -> /etc/init.d/vmware

lrwxrwxrwx  1 root root  18 Oct 15 01:07 webmin -> /etc/init.d/webmin

root@laptop root #

----------

## UberLord

https://bugs.gentoo.org/show_bug.cgi?id=34484

Basically emerge baselayout-1.11.8 and it will start working  :Smile: 

----------

## afabco

got it.  Works. 

Two questions:

1.  There is now an /etc/init.d/net.eth0.  Keep it?  Move it?  Delete it?  link it in a run level?

2.  I ended up having to load the natsemi driver in /etc/modules.autoload/kernel-2.6 to make this work.  Is that right?

Thanks again!

----------

## UberLord

 *afabco wrote:*   

> 1.  There is now an /etc/init.d/net.eth0.  Keep it?  Move it?  Delete it?  link it in a run level?

 

With baselayout-1.11.x, net.eth0 is a symlink to net.lo - thus net.eth0 can be removed from /etc/init.d and/or from any runlevels without any adverse effects. Providing that you don't actually have/use an eth0 interface  :Wink: 

 *Quote:*   

> 2.  I ended up having to load the natsemi driver in /etc/modules.autoload/kernel-2.6 to make this work.  Is that right?

 

That's one way of loading modules - there are others. Which is better or worse is generally left for the user to decide.

I load my modules there if that's any help

----------

## afabco

Actually, the natsemi is eth0, so I guess I do need to keep it.  Thx

> With baselayout-1.11.x, net.eth0 is a symlink to net.lo - thus net.eth0 can be removed from 

> /etc/init.d and/or from any runlevels without any adverse effects. Providing that you don't 

> actually have/use an eth0 interface

----------

## afabco

Should ifplugd be in the boot runlevel or the default runlevel?

----------

## UberLord

default

boot is only for critical services needed to errrr - boot   :Idea: 

----------

## okram

 *Quote:*   

> Basically emerge baselayout-1.11.8 and it will start working 

 

I've got baselayout-1.11.12-r1 and it's not working. Ifplugd is not calling dhcpcd. Any ideas?

----------

## UberLord

Have you checked your logs to see if ifplugd is working correctly?

----------

## okram

yes, i have. i've looked through the logs and googled this problem some more. is it possible that the fault lies with my yukon marvell gigabit nic? using mii-diag i get:

 *Quote:*   

> Using the default interface 'eth0'.
> 
> SIOCGMIIPHY on eth0 failed: Operation not supported

 

This is using the SKGE module.  I got the same result with the older SK98LIN, too, though. Has anyone got this working with ifplugd?

----------

## UberLord

Well, that error shows that ifplugd isn't working on your card - so there's no change that it will trigger net.eth0 to get a dhcp address.

Try changing the API mode ifplugd uses in /etc/conf.d/ifplugd

Consult the ifplugd manpage for more details

----------

## okram

Thanks. I'll have a go at that and report back.

----------

## okram

i've now tried different options for API_MODE in /etc/conf.d/ifplugd.

what i now get with all of them is the following message in /etc/var/log/everything/current, repeated every twenty seconds or so:

 *Quote:*   

> May 24 19:45:49 [kernel]      osl-0958 [7949] os_wait_semaphore     : Failed to acquire semaphore[c17de580|1|0], AE_TIME
> 
> May 24 19:46:08 [kernel]      osl-0958 [8061] os_wait_semaphore     : Failed to acquire semaphore[c17de580|1|0], AE_TIME
> 
> May 24 19:46:28 [kernel]      osl-0958 [8205] os_wait_semaphore     : Failed to acquire semaphore[c17de580|1|0], AE_TIME

 

and the cpu load goes up to 100% while the system slows down to a virtual standstill.

is this an acpi problem? if so, what can i do?

----------

## UberLord

Looks like a kernel/driver problem for sure.

After a quick google, I can't find a fix. Try using the latest ~ARCH gentoo-sources and/or drivers.

If that fails, I would open a new bug on bugs.gentoo.org

----------

## okram

Thanks. I'll have a go at that. Currently using sys-kernel/gentoo-sources-2.6.11-r9, but maybe I'll play around a bit more with different driver options. I'll post back if I can solve it.

----------

## okram

it's getting more and more confusing.  :Sad: 

previously, i built the NIC driver into the kernel. in order to test the two different versions for my yukon marvell (skge and sk98lin) i rebuilt them as modules.

now, with skge ifplugd freezes up. with sk98lin it doesn't, but nor does it bring up the interface. however, even with both net.eth0 and ifplugd removed from all runlevels at startup, the kernel automatically & successfully brings up net.eth0 if i 

```
modprobe sk98lin
```

 and brings it down if i 

```
rmmod sk98lin
```

. works equally well with 

```
modprobe skge
```

 and 

```
rmmod skge
```

 but ifplugd doesn't work at all.

any ideas?

----------

## okram

this continues to baffle me in new ways every day.

i realised that after adding hotplug/coldplug to boot runlevel, the insertion of the nic kernel module no longer automatically brings up the network. what are the processes that determine this? where can i find out how all these different things udev, sysfs, devfs, hotplug, coldpug, ifplugd are supposed to work with each other or against each other in general and in gentoo in particular? I want to RTFM but don't know where it is...

at the moment, i have no idea whether ifplugd fails to bring up the network on my laptop because of a missing or bad kernel configuration; whether the laptop hardware (nic, acpi) doesn't play ball with ifplugd; whether i should/should not use ifplugd in conjunction with a specific hotplug/coldplug configuration. or something else.

----------

## rpgdude

Just a note, when removing modules you should use 

```
modprobe -r module_name
```

instead of using

```
rmmod module_name
```

----------

