NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

need help with ifwatchd and dhcpcd



My wife's iwn frequently fails, sometimes multiple times a day. 
Sometimes later it comes alive again. But if I try to ifconfig down and 
up on it, I can't get any lease. We have physically rebooted several 
times but sometimes that doesn't help.

I saw "Subject: rbuf starvation in the iwn driver" on 
tech-kern/tech-net. Maybe that is related.

So we have an external ral0.

I setup ifwatchd. It is currently running like:

/usr/sbin/ifwatchd -v -A /home/heather/network-interface-plugged-in.sh ral0

When I plug in the ral0 to the USB, it runs the script.

The script is:

#!/bin/sh

interface=$1

if [ -r "/etc/ifconfig.${interface}" ]; then
  /sbin/ifconfig ${interface} `cat /etc/ifconfig.${interface}`
fi

/sbin/dhcpcd --reconfigure ${interface}
#/sbin/dhcpcd --reconfigure
#/sbin/dhcpcd --rebind ${interface}
#/sbin/dhcpcd --rebind

######################

The ifconfig assigns the nwid and nwkey and the ral0 is active.

But the dhcpcd --rebind without the interface attempts to rebind iwn0. 
When I do the dhcpcd --rebind for ral0, it never gets a lease:

Apr  8 08:38:30 tx dhcpcd: sending signal 14 to pid 115
Apr  8 08:38:30 tx dhcpcd: received SIGALRM, rebinding lease
Apr  8 08:38:30 tx dhcpcd: re0: broadcasting for a lease

I waited for 90 seconds and no luck. I tried this a few times.

So I tried with dhcpcd --reconfigure:

Apr  8 08:46:41 tx dhcpcd: sending signal 30 to pid 115
Apr  8 08:46:41 tx dhcpcd: received SIGUSR, reconfiguring
Apr  8 08:46:41 tx dhcpcd: waiting for pid 115 to exit
Apr  8 08:46:52 tx dhcpcd: pid 115 failed to exit

I tried this a few times. The pid 115 is correct. It failed to 
"reconfigure".

Then I tried "dhcpcd --reconfigure ral0" and:

Apr  8 08:49:35 tx dhcpcd: sending commands to master dhcpcd process
Apr  8 08:49:35 tx dhcpcd: control command: /sbin/dhcpcd --reconfigure ral0

Nothing noticable.

By the way during this whole time of experiments, the iwn0 stayed 
unconfigured.

So then I decided to restart dhcpcd with "/etc/rc.d/dhcpcd restart".
The rc.d script said:

dhcpcd not running? (check /var/run/dhcpcd-ral0.pid).

And then restarting dhcpd complained:

Apr  8 08:50:32 tx dhcpcd: dhcpcd already running on pid 115 
(/var/run/dhcpcd.pid)

Ooops that is caused by my /etc/rc.conf.d/dhcpcd file which contains:

pidfile=/var/run/dhcpcd-ral0.pid

I had that long ago before I used iwn, because I specifically used 
dhcpcd with ral0. But then restart using the rc.d script would fail 
because the rc.d pidfile didn't match what dhcpcd really used. I moved 
this /etc/rc.conf.d/dhcpcd file. But anyways that is unrelated to my 
problems.

So I killed dhcpcd and restarted it. Both iwn0 and ral0 immediately were 
assigned leases!

Apr  8 08:51:51 tx dhcpcd: received SIGTERM, stopping
Apr  8 08:51:51 tx dhcpcd: ral0: removing interface
Apr  8 08:51:51 tx dhcpcd: re0: removing interface
Apr  8 08:51:56 tx sudo:  heather : TTY=pts/0 ; PWD=/home/heather ; 
USER=root ; COMMAND=/etc/rc.d/dhcpcd restart
Apr  8 08:51:56 tx dhcpcd: version 5.0.6 starting
Apr  8 08:51:56 tx dhcpcd: re0: broadcasting for a lease
Apr  8 08:51:56 tx dhcpcd: iwn0: rebinding lease of 192.168.1.4
Apr  8 08:51:56 tx dhcpcd: ral0: broadcasting for a lease
Apr  8 08:52:01 tx dhcpcd: iwn0: acknowledged 192.168.1.4 from 192.168.1.1
Apr  8 08:52:01 tx dhcpcd: iwn0: checking for 192.168.1.4
Apr  8 08:52:01 tx dhcpcd: ral0: offered 192.168.1.5 from 192.168.1.1
Apr  8 08:52:02 tx dhcpcd: ral0: acknowledged 192.168.1.5 from 192.168.1.1
Apr  8 08:52:02 tx dhcpcd: ral0: checking for 192.168.1.5
Apr  8 08:52:06 tx dhcpcd: iwn0: leased 192.168.1.4 for 86400 seconds
Apr  8 08:52:06 tx dhcpcd: forking to background
Apr  8 08:52:06 tx dhcpcd: ral0: leased 192.168.1.5 for 86400 seconds

I have had this problem often.

Is it normal to have to restart dhcpcd for it to rebind (like now iwn0 
has an address) or to recognize a new interface (like ral0)?

Any hints or suggestions on how to get dhcpcd to recognize and work to 
get a lease without restarting?

For now, I will just use "/etc/rc.d/dhcpcd restart" but it seems like 
doing a --rebind or --reconfigure would be better.

By the way, wpa_supplicant doesn't work for me at all on this system 
with ral0 nor iwn0. That is another issue I hope to resolve...


Home | Main Index | Thread Index | Old Index