I met the following problem with my computer equipped of a Marvell Yukon-EC Ultra network interface :
When I started my computer, the network interface was not working.
But an
switched it on
In the logs I could read :
It seems that the networking interface is not switched on enough quickly during boot-up.
Start the network services at hand after the startup was not very pratical
.
So this is what I have done using the functionnalities of upstart.
1) When kdm is started, emit the kdm-started signal
2) When upstart receives the kdm-started signal, it restart the network
First, create a new script /etc/event.d/restart-network
Then, in the /etc/init.d/kdm-kde4 script, add the line "initctl emit kdm-started" :
Be carefull of the owners and rights of the script restart-network
And voila !
When I started my computer, the network interface was not working.
But an
Code:
/etc/init.d/networking restart
In the logs I could read :
sky2 eth0: enabling interface
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): eth0: link is not ready
Start the network services at hand after the startup was not very pratical
.So this is what I have done using the functionnalities of upstart.
1) When kdm is started, emit the kdm-started signal
2) When upstart receives the kdm-started signal, it restart the network
First, create a new script /etc/event.d/restart-network
Code:
# Restart-network
#
# This task restarts the network when kdm has started
# The module Sky2 doesn't start the network enought quickly during boot-up.
start on kdm-started
script
# Wait for 5 seconds and restart the network interfaces
sleep 5
exec /etc/init.d/networking restart
end script
Code:
case "$1" in
start)
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting K Display Manager (kdm-kde4); it is not the default display manager."
else
# if usplash is running, make sure to stop it now, yes "start" kills it.
if pidof usplash > /dev/null; then
DO_NOT_SWITCH_VT=yes /etc/init.d/usplash start
fi
echo -n "Starting K Display Manager: kdm-kde4"
start-stop-daemon --start --quiet $SSD_ARGS -- $ARG || echo -n " already running"
echo "."
# -> HERE <-
initctl emit kdm-started
# -> HERE <-
fi
;;
And voila !