after installing netplug i found some problems. my config: eth0 and eth1 have 0.0.0.0 as ip. the 2 interfaces are bridged with "blight" bridge. all works good. bugs found: 1) with my config eth0/1 start always returns 1. after line 83 in netplug module i put start-stop-daemon --start --exec /sbin/netplugd \ --pidfile "${pidfile}" \ -- -i "${iface}" -P -p "${pidfile}" -c /dev/null eend $? return $? and this makes it return 0 correctly, skipping the rest of function after having eth0 and 1 working i tried to start my bridge 2) /etc/init.d/net.blight start * Starting eth0 * Starting netplug on eth0 ... [ ok ] * Bringing up eth0 * 0.0.0.0 [ ok ] * Starting eth1 * Starting netplug on eth1 ... [ ok ] * Bringing up eth1 * 0.0.0.0 [ ok ] * ERROR: Problem starting needed services. * "net.blight" was not started. bridge doesn't start. actually i just moved the netplugd name, so netplug script exit immediatly. it would be interesting to say "not to monitor" the bridge interface that should be always up.
Created attachment 70299 [details] new netplug init script remove all netplug* files from /lib/rcscripts/net.modules.d and then put this new file in. New version checks to see if there is a valid MAC address and refuses to work on bridge and tuntap interfaces.
i get errors and netplugd doesn't start so /etc/init.d/net.blight start * Caching service dependencies ... [ ok ] * Starting eth0 * netplug does not support the required function check_installed * Bringing up eth0 * 0.0.0.0 [ ok ] * Starting eth1 * netplug does not support the required function check_installed * Bringing up eth1 * 0.0.0.0 [ ok ] * Starting blight * netplug does not support the required function check_installed * Creating bridge blight ... [ ok ] * Adding ports to blight * eth0 ... [ ok ] * eth1 ... [ ok ] * Bringing up blight * 172.16.92.100
cd /lib/rcscripts/net.modules.d mv netplug netplugd Try that
now i get: /etc/init.d/net.blight start * Starting eth0 * Starting netplug on eth0 ... [ ok ] * Failed to configure eth0 in the background [ !! ] * Starting eth1 * Starting netplug on eth1 ... [ ok ] * Failed to configure eth1 in the background [ !! ] * ERROR: Problem starting needed services. * "net.blight" was not started. same error as before. i wrote what i need to do to bypass ip check and similar..
Could you attach your conf.d/net file to this bug please
config_eth0="0.0.0.0" config_eth1="0.0.0.0" config_blight="172.16.92.100 broadcast 172.16.92.255 netmask 255.255.255.0" bridge_blight="eth0 eth1" depend_blight() { need net.eth0 net.eth1 } consider another problem, if the netplug stuff will be fixed. this way eth0/1 down will make bridge go down. and this should never happen...
OK, the issue is that 0.0.0.0 is mistakenly being reported as being used on the lan interfaces. This will be fixed in the next release. There is a workaround though, like so config_eth0=( "null" ) config_eth1=( "null" ) If you don't want netplug or ifplugd to control your interfaces (ie bring them up or down) then you can add this modules=( "!netplugd" "!ifplugd" ) This stops the bridge being taken down if an interface cable is pulled.
You can always change the dep from need to after (or try use as well) instead of disabling netplugd/ifplugd as that should keep the bridge up.
even with null address i have /etc/init.d/net.eth0 start * Starting eth0 * Starting netplug on eth0 ... [ ok ] * Failed to configure eth0 in the background and the scripts lasts a lot of time. (yes is see that's a timer..) the nice thing it that eth0 and netplug are started. script is still bugged
Is netplug bringing up the interface at all? Check by doing this grep netplug /var/log/messages | tail -n 10 (/var/log/messages may or may not be your default log file) Attach the results here.
syslog:Oct 11 11:05:44 blight netplugd[19263]: /etc/netplug.d/netplug eth0 in -> pid 19263 syslog:Oct 11 11:05:46 blight netplugd[19262]: eth0: state INNING flags 0x00001043 UP,BROADCAST,RUNNING,MULTICAST -> 0x00001003 UP,BROADCAST,MULTICAST syslog:Oct 11 11:05:55 blight netplugd[19262]: eth0: state WAIT_IN pid 19263 exited status 0 syslog:Oct 11 11:05:55 blight netplugd[19828]: /etc/netplug.d/netplug eth0 out -> pid 19828 syslog:Oct 11 11:06:21 blight netplugd[19262]: eth0: state OUTING pid 19828 exited status 0 eth0 and netplugd are up...it's a script problem ihmo
OK, that shows that netplug is bringing eth0 down - which it should not be I do not get this issue with my natsemi adapter, so it may also be a nic driver issue (I'm not ruling out that it maybe a script issue).
no it's not a driver problem. i had no cable plugged, so it starts, polls and stops... the strange thing is: why eth0 keeps on?
OK, it's working fine then :) As I said, if you don't want this behaviour then unmerge netplug or disable it on the bridge interfaces using the modules=( "!netplugd" ) statement
Why it keeps on? It's marked as "inactive" This is so the netplug can start and stop the script depending on cable being in/out. It also sets a special variable so it does not re-spawn netplug when starting it, and it does not kill it or bring down the interface when stopping it. ifplugd and wpa_supplicant also work like this
no wait....if netplug shutdown the eth0...it's ok...it's its job. the problem is that the rc-script doesn't work, returns 1. and eth0 is still up. this is the problem. should be: 1)eth0 starts, and it's up 2) netplug starts, checks and shutdown eth0 3) net.eth0 script finishes with status 0 and make net.eth0 service as started, so other services can be started. this doesn't happen
And that won't happen. Netplug is doing it's job as designed. It's marking eth0 as "inactive" so that scripts that depend on it will fail. This is behaviour by design. Maybe we can solve this another way? Try this config - remove any existing config_blight=( "172.16.92.100 broadcast 172.16.92.255 netmask 255.255.255.0" ) # Set at least one option to ensure that a bridge is created as we are not specifying and ports brctl_blight=( "setfd 0" "sethello 0" "stp off" ) config_eth0=( "null" ) bridge_add_eth0="blight" config_eth1=( "null" ) bridge_add_eth1="blight" You could also do this if you wanted to depend_eth0() { after net.blight } depend_eth1() { after net.blight } What we've done is created a bridge without any ports. When eth0 comes up, we've added it to the bridge - this is controlled by netplug HTH
change specifying and ports to # specifying and ports
i continue to repeat that it's not the way netplug should work. service should be started return 0, THEN netplug should put it on/off. but service should be started, because it is!
I you really want that behaviour, you can do this plug_timeout_eth0="-1" plug_timeout_eth1="-1"
/etc/init.d/net.eth0 start * Starting eth0 * Starting netplug on eth0 ... [ ok ] * WARNING: negative timeout set for eth0 root@blight conf.d # echo $? 1 we are near solution :)
oops no... /etc/init.d/net.blight start * Starting blight * Creating bridge blight ... [ ok ] * Bringing up blight * 172.16.92.100 root@blight conf.d # /etc/init.d/net.eth0 start * Starting eth0 * Starting netplug on eth0 ... [ ok ] * WARNING: negative timeout set for eth0 root@blight conf.d # /etc/init.d/net.eth1 start * Starting eth1 * Starting netplug on eth1 ... [ ok ] * WARNING: negative timeout set for eth1 root@blight conf.d # brctl show bridge name bridge id STP enabled interfaces blight 8000.000000000000 no no device plugged to bridge...
I'm guessing that's because the cable is unplugged still. Try plugging cables in (ensure other end is active) and then you'll see them magically added to the bridge. BTW, with a negative timeout OR netplug failing (ie no cable) will always return 1 - this will not change and is not open to discussion for baselayout-1.12.x series as changing it would break too many things.
i'll try, i understand that baselayout must go stable, but "it breaks too many things" is not a valid excuse :) i think we can close, but that should be fixed in next baselayout versions. please notice and consider that. Thanks for help
Let me put it another way. If a daemon controls an interface then when it's not operatinal (not associated to an access point, cable not plugged in, dhcp lost lease, etc) then it's marked as "inactive" and marked as "started" when it is operational (associated to an access point, cable plugged in, lease obtained). We also know this by our return codes - "started" == 0 and anything else == 1. Now, internally to baselayout-1.12.0 we no longer care about the return code - we just check to see if service is marked as started or not - however other scripts rely on the fact that if it returns 0 then it should be working. Obviously it won't work if a cable is not plugged in, hence returning 1. So I'm now going to mark this bug as CLOSED. If you still have issue with this, then either debate with the rest of the baselayout developers on #gentoo-base irc.freenode.net or email the gentoo-dev list or open a new bug. Here's a good title "rc script return codes for inactive interfaces" and make your argument generic as wpa_supplicant, ifplugd and netplugd have to work the same way. If you want, you can edit /sbin/runscript.sh and change the return code on line 378 which should return the 0 you so desperately crave .... but you're going to have to put forward a very good argument to get us to change it.
ok i do agree. i'll be in chan, thanks for your support and patience, bee so kind :)