Although the noshutdown keyword is nice, we shouldn't use it for network or dhcpcd. Instead fake network shutdown so it comes back up correctly at boot and KILL dhcpcd to preserve network.

This commit is contained in:
Roy Marples 2009-04-27 13:33:37 +00:00
parent 824bb3aee3
commit 3d43fb6f22
3 changed files with 17 additions and 3 deletions

View File

@ -6,6 +6,8 @@
# You also have ifup_eth0 and ifdown_eth0 to run other commands when # You also have ifup_eth0 and ifdown_eth0 to run other commands when
# eth0 is started and stopped. # eth0 is started and stopped.
# You should note that we don't stop the network at system shutdown by default.
# If you really need this, then set shutdown_network=YES
# You can assign a default route # You can assign a default route
#defaultroute="192.168.0.1" #defaultroute="192.168.0.1"

View File

@ -14,5 +14,14 @@ depend()
use logger use logger
after bootmisc modules after bootmisc modules
before dns before dns
keyword noshutdown }
stop_pre()
{
# When shutting down, kill dhcpcd but preserve network
# We do this as /var/run/dhcpcd could be cleaned out when we
# return to multiuser.
if yesno $RC_GOINGDOWN; then
: ${stopsig:=SIGKILL}
fi
} }

View File

@ -13,8 +13,6 @@ depend()
need localmount need localmount
after bootmisc after bootmisc
provide net provide net
# We don't want to stop the network at shutdown
keyword noshutdown
keyword nojail noprefix novserver keyword nojail noprefix novserver
} }
@ -240,6 +238,11 @@ start()
stop() stop()
{ {
# Don't stop the network at shutdown.
# We don't use the noshutdown keyword so that we are started again
# correctly if we go back to multiuser.
! yesno ${shutdown_network:-YES} && yesno $RC_GOINGDOWN && return 0
local int= intv= cmd= downcmd= r= local int= intv= cmd= downcmd= r=
einfo "Stopping network" einfo "Stopping network"
routeflush routeflush