The depend function for network init scripts doesn't work if you set different init profiles. Sometimes I connect to the internet through a lan with a dhcp server, other times I make an adsl connection through a wifi modem/router. I have two runlevels: default and adsl. In the default runlevel the network is set on dhcp, in the adsl is set to make a point-to-point adsl connection, so I have two different configuration files (ath0 is a wifi 802.11 card using madwifi drivers): /etc/conf.d/net (for the default runlevel): > > config_eth0="dhcp" > config_ath0="null" > /etc/conf.d/net.adsl (for the adsl runlevel): > > config_eth0="null" > config_ath0="dhcp" > config_ppp0="ppp" > link_ppp0="ath0" > plugins_ppp0="pppoe" > pppd_ppp0=( "updetach" "defaultroute" "usepeerdns" ) > The ppp adsl connection works over the wifi connection. To make it work I have to automatically start also the net.ath0 script as a dependency for the net.ppp0 script, because it does the WEP autentication (I didn't report my passwords and wep key for simplicity), so I have to put the following lines in /etc/conf.d/net.adsl: > > depend_ppp0() { > need net.ath0 > } > as written in net.example. It doesn't work. After investigating (putting some echoes in the depend() function in the net.lo init script) I found that I have to put the same 3 lines in /etc/conf.d/net and not in /etc/conf.d/net.adsl. So the depend_${iface}() function only works if you put it in /etc/conf.d/net and in this way it will be called for every runlevel (which is a wrong behavior). And if I want two different configurations for net.ppp0, one with a dependency and the other without dependency, or maybe with different dependencies, it will not work. I think the problem is in the /etc/init.d/net.lo script.
I'm not going to fix this as we cannot have dependencies different between runlevels. Would you be happy if I added a note to say this in net.example? NOTE: Due to the way we handle our init.d script dependencies you cannot put a depend_ppp0() in /etc/conf.d/net.$runlevel - it has to be in /etc/conf.d/net
I didn't know that it was impossible to have different dependecies between runlevels. I thought it was logical that different configurations can have also different dependencies. Maybe it's better if you add that note in net.example, so that other users that make use of a depend function wouldn't be confused about that. Thanks. My problem has been resolved with a preup function that registers to the essid and makes the wep autentication and a postdown function that brings ath0 down.
Documented in our svn repo - will be in baselayout-1.12.2
Fixed