Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196136 - Dhcpcd does not daemonize until after obtaining IP address - problem with wireless
Summary: Dhcpcd does not daemonize until after obtaining IP address - problem with wir...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-17 07:17 UTC by Antti Mäkelä
Modified: 2007-10-23 10:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Mäkelä 2007-10-17 07:17:31 UTC
I just ran into this issue during poor WLAN conditions..

I have set up my "fn-f5" shortcut key to start up or shut down net.wlan and turn on radio, basically as such, with wlan_change_state.sh in acpi actions. I'm using wpa_supplicant:

#!/bin/sh
if iwconfig wlan | grep "radio off" > /dev/null ; then
  echo 0 > /sys/class/net/wlan/device/rf_kill
  sleep 2
  /etc/init.d/net.wlan start > /dev/null &
else
  /etc/init.d/net.wlan stop > /dev/null &
  sleep 2
  echo 1 > /sys/class/net/wlan/device/rf_kill
fi

  Now, here's a problem I ran into at shaky WLAN connection: I got associated, but the signal was so weak that no actual traffic went through. Problem is that dhcpcd is started up but since it does not obtain IP address, stopping the interface does not work. When attempting to do it directly on the command line, I get

# ps ax | grep dhcp
14534 ?        S      0:00 /sbin/dhcpcd -t 0 -p -N -Y -m 2000 wlan
28096 pts/0    S+     0:00 grep --colour=auto dhcp
# /etc/init.d/net.wlan stop
 * Stopping wlan
 *     /etc/conf.d/wireless is deprecated
 *     Please put all settings in /etc/conf.d/net
 *     /etc/conf.d/wireless is deprecated
 *     Please put all settings in /etc/conf.d/net

 *   Running predown function                                             [ ok ]
 *   Bringing down wlan
 *     Stopping dhcpcd on wlan ...
Error, wlan: dhcpcd not running                                           [ !! ]

/var/run/dhcpcd-wlan.pid is of zero length. Of course, this is because dhcpcd only daemonizes after it has obtained an IP address.

Not sure if this is something that should be fixed with baselayout or dhcpcd - or somewhere else.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-10-17 09:48:44 UTC
What baselayout and dhcpcd versions?
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-10-17 10:54:16 UTC
Could you try a new dhcpcd version please?
http://dev.gentoo.org/~uberlord/dhcpcd-3.1.7_pre2.tar.bz2

To install do this
cd /tmp
wget http://dev.gentoo.org/~uberlord/dhcpcd-3.1.7_pre2.tar.bz2
tar xvjpf dhcpcd-3.1.7_pre2.tar.bz2
cd dhcpcd-3.1.7_pre2
make
install dhcpcd /sbin
Comment 3 Antti Mäkelä 2007-10-17 11:34:35 UTC
Baselayout is 1.12.9-r2 and dhcpcd is 3.1.5-r1. I'll try the new version, thanks. 
Comment 4 Antti Mäkelä 2007-10-17 23:30:33 UTC
The new dhcpcd apparently fixes this issue - the PIDfile appears immediately, before daemonizing, so net.xxxx knows which process to kill.

Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-10-23 10:49:29 UTC
3.1.7 is out