Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88372 - per essid options to dhcpcd do not work in baselayout-1.11.10-r4
Summary: per essid options to dhcpcd do not work in baselayout-1.11.10-r4
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 66472
  Show dependency tree
 
Reported: 2005-04-08 09:24 UTC by georg.lippold
Modified: 2005-04-08 14:56 UTC (History)
1 user (show)

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 georg.lippold 2005-04-08 09:24:29 UTC
although the config_ESSID and dhcpcd_ESSID options in /etc/conf.d/wireless are honoured by /etc/init.d/net.ethX start, the nameservers_ESSID, domain_ESSID and searchdomains_ESSID options are not applied when setting dhcpcd_ESSID="-R".

Here is a sample of my /etc/conf.d/wireless

config_WLAN_Georg=( "dhcp" )
dhcpcd_WLAN_Georg=" -R "
config_Uni_Bremen=( "dhcp" )
dhcpcd_Uni_Bremen=" -R "
nameservers_WLAN_Georg=( "192.168.0.2" "134.102.200.14" "134.102.20.20" )
domain_WLAN_Georg="wlan.netz informatik.uni-bremen.de uni-bremen.de"
searchdomains_WLAN_Georg="wlan.netz informatik.uni-bremen.de uni-bremen.de"
nameservers_Uni_Bremen=( "134.102.200.14" "134.102.20.20" )
searchdomains_Uni_Bremen="informatik.uni-bremen.de uni-bremen.de"
domain_Uni_Bremen="informatik.uni-bremen.de uni-bremen.de"

Maybe this is again an LC_ALL=C issue like in

http://bugs.gentoo.org/show_bug.cgi?id=88175

Reproducible: Always
Steps to Reproduce:
1. insert the above in your /etc/conf.d/wireless wrt. your essid
Actual Results:  
/etc/resolv.conf is not modified according to the settings

Expected Results:  
/etc/resolv.conf should have had the above settings
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-04-08 10:27:17 UTC
Probably. Edit /lib/rcscripts/net.modules.d/essidnet and change line 64 to read

local essid
LC_ALL=C essid=${ESSID//[![:word:]]/_}

(So that's changing 1 line into 2 lines)
Comment 2 georg.lippold 2005-04-08 14:33:57 UTC
OK, I did that but it doesn't fix the problem. The ${essid} and ${ESSID} now have the correct value. (I tested with echo). All other values in the script are proper too, and even /etc/resolv.conf is properly written by the script. I added a 'cat /etc/resolv.conf' before essidnet_pre_start() returns. Now the output of the script is (## are additional comments for your convenience)

 * Starting eth1
 *    Loading networking modules for eth1
 *       modules: iwconfig essidnet iptunnel ifconfig adsl dhcpcd apipa
 *          iwconfig provides wireless
 *          ifconfig provides interface
 *          dhcpcd provides dhcp
 *    Configuring wireless network for eth1
 *    Trying to force preferred in case they are hidden
 *    Connecting to "WLAN-Georg" (WEP enabled - open) ...                      [ ok ]
 *       eth1 connected to "WLAN-Georg" at 00:01:36:07:16:E1
 *       in managed mode (WEP enabled - open)
 *    Configuring eth1 for "WLAN-Georg" ...
## for x in ${nameservers[@]} ; do echo ${x} ...
nameserver 192.168.0.2
nameserver 134.102.200.14
nameserver 134.102.20.20
## [[ -n ${x} ]] && echo "search ${x}" && echo "search ${x}" >> /etc/resolv.conf
search wlan.netz informatik.uni-bremen.de uni-bremen.de
## cat /etc/resolv.conf
# Generated by net-scripts essidnet module
domain wlan.netz informatik.uni-bremen.de uni-bremen.de
nameserver 192.168.0.2
nameserver 134.102.200.14
nameserver 134.102.20.20
search wlan.netz informatik.uni-bremen.de uni-bremen.de                        [ ok ]
 *    Bringing up eth1
 *       dhcp
 *          Running dhcpcd ...                                                 [ ok ]
 *          eth1 received address 192.168.0.100
 *    Running postup function

But finally, the /etc/resolv.conf reappears from somewhere. It might be an issue that I use pptp in my second environment. My pptpclient is pptpclient-1.5.0-r1 and upon starting it creates a /etc/resolv.conf.pppd-backup, but that is just a thought with not much evidence, since I deleted that file already, but the /etc/resolv.conf didn't get written properly. I don't know from where dhcpcd (or any other script involved) gets that backup it then restores.
I already looked in the dhcpcd script, but didn't find the error on first sight. Maybe you have an idea?
Comment 3 georg.lippold 2005-04-08 14:56:21 UTC
seems to be an issue with /lib/rcscripts/net.modules.d/helpers.d/config-system, that is the only other script that uses /etc/resolv.conf.sv. It should be called before essidnet is run, not after, because it then restores (upon startup) the just saved resolv.conf.sv to resolv.conf. I changed line 93 in essidnet to 

[[ -f /etc/resolv.conf ]] && mv /etc/resolv.conf /etc/resolv.conf.bak

and now dhcpcd does not restore the newly created /etc/resolv.conf. Additionally, I added a new Line 29 to helpers.d/config-system

[[ -f /etc/resolv.conf.bak ]] && mv /etc/resolv.conf.bak /etc/resolv.conf

and now everything runs as expected