* Don't use /sys/class/net/*/operstate to find out the active interface,
since there seems to be a delay after the interface is brought up before operstate reflects that. svn path=/nixu/trunk/; revision=7121
This commit is contained in:
parent
9ac2e48e26
commit
3055ff0ae6
|
@ -10,9 +10,21 @@ start on network-interfaces/started
|
|||
stop on network-interfaces/stop
|
||||
|
||||
script
|
||||
# Determine the interface on which to start dhclient.
|
||||
interfaces=
|
||||
for i in $(cd /sys/class/net && ls -d *); do
|
||||
if test \"$i\" != \"lo\" -a \"$(cat /sys/class/net/$i/operstate)\" != 'down'; then
|
||||
|
||||
# !!! apparent race; operstate seems to have a slight delay, so
|
||||
# if dhclient is started right after network-interfaces, we don't
|
||||
# always see all the interfaces.
|
||||
|
||||
#for i in $(cd /sys/class/net && ls -d *); do
|
||||
# if test \"$i\" != \"lo\" -a \"$(cat /sys/class/net/$i/operstate)\" != 'down'; then
|
||||
# interfaces=\"$interfaces $i\"
|
||||
# fi
|
||||
#done
|
||||
|
||||
for i in $(ifconfig | grep '^[^ ]' | sed 's/ .*//'); do
|
||||
if test \"$i\" != \"lo\"; then
|
||||
interfaces=\"$interfaces $i\"
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -12,11 +12,12 @@ start script
|
|||
export MODULE_DIR=${kernel}/lib/modules/
|
||||
|
||||
${module_init_tools}/sbin/modprobe af_packet
|
||||
|
||||
|
||||
for i in $(cd /sys/class/net && ls -d *); do
|
||||
echo \"Bringing up network device $i...\"
|
||||
${nettools}/sbin/ifconfig $i up || true
|
||||
done
|
||||
|
||||
end script
|
||||
|
||||
# Hack: Upstart doesn't yet support what we want: a service that
|
||||
|
@ -25,7 +26,7 @@ respawn sleep 10000
|
|||
|
||||
stop script
|
||||
for i in $(cd /sys/class/net && ls -d *); do
|
||||
echo \"Bringing up network device $i...\"
|
||||
echo \"Taking down network device $i...\"
|
||||
${nettools}/sbin/ifconfig $i down || true
|
||||
done
|
||||
end script
|
||||
|
|
Loading…
Reference in New Issue