Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489178 - mounting root read-only fails
Summary: mounting root read-only fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords: PATCH
: 520266 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-23 17:16 UTC by Joe M
Modified: 2016-11-19 11:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch to rc-mount.sh (rc-mount.patch,461 bytes, patch)
2013-10-23 17:24 UTC, Joe M
Details | Diff
updated rc-mount.sh (rc-mount.sh,1.76 KB, application/x-shellscript)
2014-08-20 04:31 UTC, Joe M
Details
updated rc-mount.sh (rc-mount.sh,1.87 KB, application/x-shellscript)
2014-08-22 13:54 UTC, Joe M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe M 2013-10-23 17:16:43 UTC
Hello,

I notice that in some shutdown/reboot scenario, mount-ro is not able to mount root readonly. It is failing with "in use but fuser finds nothing"

I suspect on multi-core machines, this issue is more probable.

Changing the relevant code as below seems to help:

"  ")
	if [ $retry -le 0 ]; then
		eend 1 "in use but fuser finds nothing"
	else
		: $(( retry -= 1 ))
		sleep 1
	fi
	;;
*)

Thanks

Reproducible: Sometimes
Comment 1 Joe M 2013-10-23 17:24:29 UTC
Created attachment 361732 [details, diff]
proposed patch to rc-mount.sh
Comment 2 Joe M 2014-08-20 04:31:05 UTC
Created attachment 383168 [details]
updated rc-mount.sh
Comment 3 William Hubbs gentoo-dev 2014-08-20 18:16:19 UTC
I noticed a couple of things about this update that I am concerned about.

- The treeps function defined on line 8, and the call to it on line 46
  and the echo on line 47 seem to be debugging code you left in, is this
  correct?

- What about the set -o commands on lines 40 and 41?

- The let command on line 53 is definitely not portable; this will fail
  for any shell other than bash, so we need something posix
  compliant for this.

- Why is bash run directly on line 57?

Also, should I close the new bug you opened as a dupe of this one? There
isn't a need to duplicate updates on more than one bug.

Thanks,

William
Comment 4 William Hubbs gentoo-dev 2014-08-20 18:39:54 UTC
(In reply to William Hubbs from comment #3)
> - The let command on line 53 is definitely not portable; this will fail
>   for any shell other than bash, so we need something posix
>   compliant for this.

 can answer this myself; the posix compliant form is the one that was originally used, so I have added it back in my copy of your changes:

: $(( retry -= 1 ))

For reference, posix compliant means compatible with this spec:

http://pubs.opengroup.org/onlinepubs/009604599/utilities/xcu_chap02.html
Comment 5 Joe M 2014-08-20 18:53:20 UTC
(In reply to William Hubbs from comment #3)
> I noticed a couple of things about this update that I am concerned about.
I put the update more as a guide rather than as patch. Sorry I was not clearer about it.

> - The treeps function defined on line 8, and the call to it on line 46
>   and the echo on line 47 seem to be debugging code you left in, is this
>   correct?
it is my debugging code, yes

> - What about the set -o commands on lines 40 and 41?
debugging code.

> - The let command on line 53 is definitely not portable; this will fail
>   for any shell other than bash, so we need something posix
>   compliant for this.
ok, thanks for pointing it out.

> - Why is bash run directly on line 57?
debugging code

> Also, should I close the new bug you opened as a dupe of this one? There
> isn't a need to duplicate updates on more than one bug.
good idea. I opened the other to show that the case statement does not work as intended. Will close that.

Thanks
Joe
Comment 6 Joe M 2014-08-20 18:53:51 UTC
*** Bug 520266 has been marked as a duplicate of this bug. ***
Comment 7 Joe M 2014-08-22 13:54:19 UTC
Created attachment 383372 [details]
updated rc-mount.sh
Comment 8 William Hubbs gentoo-dev 2016-09-12 22:24:36 UTC
Hey Joe,

where are we on this bug? can version 0.21.7 be used with read-only root?
Comment 9 Joe M 2016-11-19 11:16:13 UTC
(In reply to William Hubbs from comment #8)
> Hey Joe,
> 
> where are we on this bug? can version 0.21.7 be used with read-only root?

Yes, 0.21.7 can be used with read-only root.

Sorry for the delayed response.