/etc/init.d/localmount stop umounts modloop
I think /etc/init.d/localmount stop should not umount modloop. /etc/init.d/modloop stop is already designed to do this.
Since /etc/init.d/localmount stop umounts modloop, a /etc/init.d/localmount restart will fail to mount any device which requires new modules to be loaded.
For example, in the document http://wiki.alpinelinux.org/w/index.php?title=Setting_up_Logical_Volumes_with_LVM, the instructions include running /etc/init.d/localmount start in order to mount a new xfs partition. This requires loading the xfs module. Here is what happens:
- localmount is already started in 1.9 upon bootup, since it is a
‘need’ dependency of /etc/init.d/bootmisc, and bootmisc is in the
boot runlevel
- Therefore the only option is to do /etc/init.d/localmount restart (rc will not allow starting of a service that is “already started”)
- /etc/init.d/localmount restart first stops localmount, which umounts modloop.
- /etc/init.d/localmount restart then tries to mount the new xfs partition, but cannot load the xfs module, so that it fails.
I think the following change should fix the problem:
--- localmount.orig Thu Oct 8 18:24:03 2009
+++ localmount Thu Oct 8 18:24:58 2009
@@ -32,7 +32,7 @@
{
# We never unmount / or /dev or $RC_SVCDIR
local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}"
- no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec"
+ no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec|/.modloop"
# RC_NO_UMOUNTS is an env var that can be set by plugins
OIFS=$IFS SIFS=${IFS-y}
IFS=$IFS:
(from redmine: issue id 178, created on 2009-10-08, closed on 2009-12-23)
- Changesets:
- Revision 52e59e90 on 2009-10-12T13:00:05Z:
main/openrc: localmount: don't umount .modloop
fixes #178
- Revision 880a404a on 2009-10-12T14:24:28Z:
main/openrc: localmount: don't umount .modloop
fixes #178
(cherry picked from commit 52e59e902232fa150e2e8ced9e66bbd5d4140023)
- Revision a4cc5931 on 2010-12-21T10:37:20Z:
main/openrc: apply patch from upstream. force root to be remounted as rw
also remove the .modloop hack. Basically, everytying in 'boot' runlevel
is for bootstrapping the system. Dont expect things work if restart
any of those services.
ref #178
- Revision 60204f87 on 2011-01-07T12:39:48Z:
main/openrc: apply patch from upstream. force root to be remounted as rw
also remove the .modloop hack. Basically, everytying in 'boot' runlevel
is for bootstrapping the system. Dont expect things work if restart
any of those services.
ref #178
(cherry picked from commit a4cc593132e169168d5b701da879998f91f3744c)