public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Rich Freeman <rich0@gentoo.org>
To: gentoo-dev <gentoo-dev@lists.gentoo.org>
Subject: Re: [gentoo-dev] Re: rfc: Does OpenRC really need mount-ro
Date: Wed, 17 Feb 2016 08:46:34 -0500	[thread overview]
Message-ID: <CAGfcS_m5fYjLvZY+uZzaqM+9zCKH-D_YkmtWtnfb+64n3mQrrw@mail.gmail.com> (raw)
In-Reply-To: <pan$5775c$d5db16fe$36a3366$a29b8c4d@cox.net>

On Tue, Feb 16, 2016 at 9:20 PM, Duncan <1i5t5.duncan@cox.net> wrote:
>
> Initial shutdown is via two targets (as opposed to specific services),

Since not everybody in this thread may be familiar with systemd, I'll
just add a quick definition.

When systemd says "target" - think "virtual service."  The equivalent
in openrc would be an init.d script that has dependencies but which
doesn't actually launch any processes.

Targets also take the place of runlevels in systemd.

Just as with runlevels in openrc they are used to synchronize
milestones during bootup, but the design is much more generic.
Presumably openrc hard-codes runlevels like sysinit, boot, and
default.  In systemd I believe it just looks at the config file and
directly launches the desired target, and then the dependency chain
for that pulls in all the targets that precede it.  Targets can depend
on other targets, and services can depend on previous targets.

The other dimension is that unit files describe what target they are
typically associated with if it isn't the default.  So, you don't run
into the sorts of situations you have with openrc that if you want to
enable mdraid support you need to remember to add it to the boot
runlevel.  That might be a relatively-easy thing to add support for in
openrc actually.

Hopefully that makes Dunan's summary easier to read for anybody who
doesn't speak systemdese.

Another bit of background that might be helpful is that systemd also
manages mounts directly.  It parses fstab and creates a network of
mount units with appropriate dependencies.  Whether you unmount
/var/tmp using "umount /var/tmp" or "systemctl stop var-tmp.mount"
systemd updates the status of the var-tmp.mount unit to a stopped
status.  I believe if you add a noauto line to fstab it will create a
mount unit automatically and not start it, and if you made it mount on
boot I think it would actually be mounted as soon as you save the file
in your editor (systemd can monitor config files for changes - all of
this is governed by scripts/software called generators).

So, systemd in general tries to stay aware of the state of mounts.  I
suspect that isn't just firing off a script to find/unmount anything
that is mounted.  From Dunan's email it sounds like you could create a
mount unit and explicitly not set a conflict with the unmount target
which would cause the filesystem to remain mounted at shutdown.  I
have no idea what that would do to unmounting the root.

-- 
Rich


  reply	other threads:[~2016-02-17 13:46 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 [this message]
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
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=CAGfcS_m5fYjLvZY+uZzaqM+9zCKH-D_YkmtWtnfb+64n3mQrrw@mail.gmail.com \
    --to=rich0@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