public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Patrick Lauer <patrick@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] rfc: Does OpenRC really need mount-ro
Date: Tue, 16 Feb 2016 20:31:54 +0100	[thread overview]
Message-ID: <56C3792A.3010602@gentoo.org> (raw)
In-Reply-To: <20160216180533.GB1450@whubbs1.gaikai.biz>

On 02/16/2016 07:05 PM, William Hubbs wrote:
> All,
>
> I have a bug that points out a significant issue with
> /etc/init.d/mount-ro in OpenRC.
>
> Apparently, there are issues that cause it to not work properly for file
> systems which happen to be pre-mounted from an initramfs [1].
I don't understand how this fails, how does mounting from the initramfs
cause issues?

The failure message comes from rc-mount.sh when the list of PIDs using a
mountpoint includes "$$" which is shell shorthand for self. How can the
current shell claim to be using /usr when it is a shell that only has
dependencies in $LIBDIR ?
As far as I can tell the code at this point calls fuser -k ${list of
pids}, and fuser outputs all PIDs that still use it. I don't see how $$
can end up in there ...

>
> This service only exists in the Linux world; there is no equivalent in
> OpenRC for any other operating systems we support.
>
> The reason it exists is very vague to me; I think it has something to do
> with claims of data loss in the past.
Yes, if you just shut down without unmounting file systems -
(1) you may throw away data in the FS cache that hasn't ended up on disk yet
(2) the filesystem has no chance to mark itself cleanly unmounted, so
you will trigger journal replay or fsck or equivalent on boot

That's why sysvinit had a random "sleep(1)" in the halt and "sleep(2)"
in the reboot function, to give computers more of a chance to shutdown
and reboot sanely.

The changes in sysvinit-2.88-r8 and later add the "-n" option:
       -n     Don't sync before reboot or halt. Note that the kernel and
storage drivers may still sync.

This was added *because* we can guarantee that filesystems are
consistent enough with mount-ro. If you wish to remove it you need to
reconsider all these little details ...
>
> I'm asking for more specific information, and if there is none, due to
> the bug I lincluded in this message, I am considering removing this
> service in 0.21 since I can't find an equivalent anywhere else.
Please don't just remove things you don't understand.
>
> Thanks,
>
> William
>
> [1] https://bugs.gentoo.org/show_bug.cgi?id=573760

Looking at the init script as of openrc-0.20.5:

~line32:
        # Bug 381783
        local rc_svcdir=$(echo $RC_SVCDIR | sed
's:/lib\(32\|64\)\?/:/lib(32|64)?/:g')
This looks relatively useless with everything migrated to /run and can
most likely be removed

~line35:
          local
m="/dev|/dev/.*|/proc|/proc.*|/sys|/sys/.*|/run|${rc_svcdir}" x= fs=
Since this is a regexp it can be cut down to something more simple - why
/dev and /dev/* when the second one is already excluded by the first
one. Also rc_svcdir is most likely a subdir of /run ...




  parent reply	other threads:[~2016-02-16 19:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 18:05 [gentoo-dev] rfc: Does OpenRC really need mount-ro William Hubbs
2016-02-16 18:22 ` Rich Freeman
2016-02-16 18:41   ` William Hubbs
2016-02-17  2:20     ` [gentoo-dev] " Duncan
2016-02-17 13:46       ` Rich Freeman
2016-02-18  8:57         ` Duncan
2016-02-18 12:22           ` Rich Freeman
2016-02-19  5:07             ` Duncan
2016-02-25 23:46               ` Raymond Jennings
2016-02-17 14:24       ` Richard Yao
2016-02-17 17:19         ` Rich Freeman
2016-02-17 17:30           ` James Le Cuirot
2016-02-17 18:06             ` Ian Stakenvicius
2016-02-17 18:32               ` Rich Freeman
2016-02-18  3:11                 ` Richard Yao
2016-02-18  9:02                   ` James Le Cuirot
2016-02-18 11:39                   ` Rich Freeman
2016-02-17 21:50             ` Daniel Campbell
2016-02-18  3:02           ` Richard Yao
2016-02-18 10:48             ` Rich Freeman
2016-02-17 14:05     ` [gentoo-dev] " Richard Yao
2016-02-16 19:31 ` Patrick Lauer [this message]
2016-02-16 20:18   ` Rich Freeman
2016-02-17 14:06     ` Richard Yao
2016-02-17 19:01     ` Andrew Savchenko
2016-02-17 19:26       ` Rich Freeman
2016-02-18  3:26       ` Richard Yao
2016-02-18  7:53         ` Andrew Savchenko
2016-02-16 20:03 ` Daniel Campbell
2016-02-17  8:24 ` Luca Barbato
2016-02-17 14:00 ` Richard Yao
2016-02-18  7:02 ` Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C3792A.3010602@gentoo.org \
    --to=patrick@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox