diff options
author | Chen Qi <qi.chen@windriver.com> | 2013-11-11 17:26:09 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-20 14:03:23 +0000 |
commit | dc80eea725906f394469b867edc1a8c72be87ad8 (patch) | |
tree | fdf86371ebc18636618c944b92570a959c5d70f0 | |
parent | 20efe19ed0a8b99fb1926c66728f0af7b086b4be (diff) | |
download | poky-dc80eea725906f394469b867edc1a8c72be87ad8.tar.gz |
sysvinit: fix problem in switching runlevels
Previously, if we switch to runlevel 1 and then switch back to runlevel
5, the network interface will be brought down and the NFS service will
not be restarted correctly.
The problem is that the networking and rpcbind services are brought down
in runlevel 1 but not brought up in runlevel 5.
This patch fixes the above problem. It's based on the assumption that
in sysvinit-based system, runlevel 1 does not have networking support.
This patch adjusts some init script parameters used by update-rc.d. It
makes sure that networking starts before rpcbind which in turn starts
before mountnfs.sh. When switching to runlevel 0, 1 and 6, the umountnfs.sh
is run first before stopping rpcbind service, and the network is brought
down afterwards.
[YOCTO #5513]
(From OE-Core rev: f12e1291b51ba6692b6809570d6a9b73c70a7fe9)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb | 2 | ||||
-rw-r--r-- | meta/recipes-core/initscripts/initscripts_1.0.bb | 4 | ||||
-rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind_0.2.0.bb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb index 9d3af34717..0f4290c7c3 100644 --- a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb +++ b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb | |||
@@ -9,7 +9,7 @@ PR = "r3" | |||
9 | inherit update-rc.d | 9 | inherit update-rc.d |
10 | 10 | ||
11 | INITSCRIPT_NAME = "networking" | 11 | INITSCRIPT_NAME = "networking" |
12 | INITSCRIPT_PARAMS = "start 40 S . stop 40 0 6 1 ." | 12 | INITSCRIPT_PARAMS = "start 10 2 3 4 5 . stop 80 0 6 1 ." |
13 | 13 | ||
14 | SRC_URI = "file://copyright \ | 14 | SRC_URI = "file://copyright \ |
15 | file://init \ | 15 | file://init \ |
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb index 2d582660fa..d46ba67b2a 100644 --- a/meta/recipes-core/initscripts/initscripts_1.0.bb +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb | |||
@@ -108,7 +108,7 @@ do_install () { | |||
108 | update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 . | 108 | update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 . |
109 | update-rc.d -r ${D} sendsigs start 20 0 6 . | 109 | update-rc.d -r ${D} sendsigs start 20 0 6 . |
110 | update-rc.d -r ${D} urandom start 30 S 0 6 . | 110 | update-rc.d -r ${D} urandom start 30 S 0 6 . |
111 | update-rc.d -r ${D} umountnfs.sh start 31 0 6 . | 111 | update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 . |
112 | update-rc.d -r ${D} umountfs start 40 0 6 . | 112 | update-rc.d -r ${D} umountfs start 40 0 6 . |
113 | update-rc.d -r ${D} reboot start 90 6 . | 113 | update-rc.d -r ${D} reboot start 90 6 . |
114 | update-rc.d -r ${D} halt start 90 0 . | 114 | update-rc.d -r ${D} halt start 90 0 . |
@@ -117,7 +117,7 @@ do_install () { | |||
117 | update-rc.d -r ${D} checkroot.sh start 06 S . | 117 | update-rc.d -r ${D} checkroot.sh start 06 S . |
118 | update-rc.d -r ${D} mountall.sh start 03 S . | 118 | update-rc.d -r ${D} mountall.sh start 03 S . |
119 | update-rc.d -r ${D} hostname.sh start 39 S . | 119 | update-rc.d -r ${D} hostname.sh start 39 S . |
120 | update-rc.d -r ${D} mountnfs.sh start 45 S . | 120 | update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 . |
121 | update-rc.d -r ${D} bootmisc.sh start 55 S . | 121 | update-rc.d -r ${D} bootmisc.sh start 55 S . |
122 | update-rc.d -r ${D} sysfs.sh start 02 S . | 122 | update-rc.d -r ${D} sysfs.sh start 02 S . |
123 | update-rc.d -r ${D} populate-volatile.sh start 37 S . | 123 | update-rc.d -r ${D} populate-volatile.sh start 37 S . |
diff --git a/meta/recipes-extended/rpcbind/rpcbind_0.2.0.bb b/meta/recipes-extended/rpcbind/rpcbind_0.2.0.bb index a75e4e1bf6..16fb7b7392 100644 --- a/meta/recipes-extended/rpcbind/rpcbind_0.2.0.bb +++ b/meta/recipes-extended/rpcbind/rpcbind_0.2.0.bb | |||
@@ -35,7 +35,7 @@ PACKAGECONFIG ??= "tcp-wrappers" | |||
35 | PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" | 35 | PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" |
36 | 36 | ||
37 | INITSCRIPT_NAME = "rpcbind" | 37 | INITSCRIPT_NAME = "rpcbind" |
38 | INITSCRIPT_PARAMS = "start 43 S . start 32 0 6 . stop 81 1 ." | 38 | INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." |
39 | 39 | ||
40 | SYSTEMD_SERVICE_${PN} = "rpcbind.service" | 40 | SYSTEMD_SERVICE_${PN} = "rpcbind.service" |
41 | SYSTEMD_AUTO_ENABLE = "disable" | 41 | SYSTEMD_AUTO_ENABLE = "disable" |