summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-27 13:33:37 +0000
committerRoy Marples <roy@marples.name>2009-04-27 13:33:37 +0000
commit3d43fb6f227729bb6837ffeea3d6e2e44b6486e2 (patch)
tree5acade010f75af46e0db44eefe18bb80eeb8519d
parent824bb3aee3940c1b0b36effaf8a8434039fdc44b (diff)
downloadopenrc-3d43fb6f227729bb6837ffeea3d6e2e44b6486e2.tar.gz
openrc-3d43fb6f227729bb6837ffeea3d6e2e44b6486e2.tar.bz2
openrc-3d43fb6f227729bb6837ffeea3d6e2e44b6486e2.tar.xz
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.
-rw-r--r--conf.d/network.in2
-rw-r--r--init.d.misc/dhcpcd.in11
-rw-r--r--init.d/network.in7
3 files changed, 17 insertions, 3 deletions
diff --git a/conf.d/network.in b/conf.d/network.in
index 2719fa8..dc0f80c 100644
--- a/conf.d/network.in
+++ b/conf.d/network.in
@@ -6,6 +6,8 @@
# You also have ifup_eth0 and ifdown_eth0 to run other commands when
# 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
#defaultroute="192.168.0.1"
diff --git a/init.d.misc/dhcpcd.in b/init.d.misc/dhcpcd.in
index 91f0110..656a2c1 100644
--- a/init.d.misc/dhcpcd.in
+++ b/init.d.misc/dhcpcd.in
@@ -14,5 +14,14 @@ depend()
use logger
after bootmisc modules
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
}
diff --git a/init.d/network.in b/init.d/network.in
index fb9668c..50ba757 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -13,8 +13,6 @@ depend()
need localmount
after bootmisc
provide net
- # We don't want to stop the network at shutdown
- keyword noshutdown
keyword nojail noprefix novserver
}
@@ -240,6 +238,11 @@ start()
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=
einfo "Stopping network"
routeflush