supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: Supervision <supervision@list.skarnet.org>
Subject: Re: s6-linux-init: Actions after unmounting filesystems
Date: Sat, 17 Aug 2019 23:01:35 +0000	[thread overview]
Message-ID: <em288742c3-85c4-4256-aa86-c196ef57db87@elzian> (raw)
In-Reply-To: <CADQ2Nw85w2Ny-E_d2gQdmTi0mhYaU68S6giOQs3h31WafS4Q-Q@mail.gmail.com>

>There are certain setups that require doing something after
>filesystems are unmounted. Two examples are LVM logical volumes and
>LUKS encrypted volumes, but I suppose there must be more cases. In any
>such setup, the shutdown sequence would include a 'vgchange -a n'
>command or 'cryptsetup close' command after filesystems are unmounted.

Ah, of course it had to be more complex... Sigh.

There are two ways to proceed here:

- If a filesystem can track all the processes that have a handle on
it, it is possible to have it be mounted/unmounted symmetrically by
the service manager. At unmount time, kill the processes that would
block the unmount operation, then perform the unmount, then run the
additional commands. In that case it's all done at the service manager
level, s6-linux-init doesn't have to do anything.

- There could be a hook in the autogenerated stage 4 script, which
runs a user-provider script, something like rc.shutdown.after-umount.
I don't much like giving control to a user script at that level, when
there are no services running and no mounted filesystems, possibly
not even /proc or /sys, and when a hang in a user script could
very well prevent a clean reboot; but it's the best I can do.
Admins/distros would have to make sure the deactivate_* functions
only call binaries that are on the root filesystem.

Thoughts?

The asymmetry of mounting and unmounting filesystems is really a pain
in the ass for the design of an init/shutdown sequence. I wanted to
keep the shutdown as quick, minimal, and reliable as possible, but it
seems there's no way to do so with those snowflake filesystems. :/

--
Laurent




  reply	other threads:[~2019-08-17 23:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-17 19:14 Guillermo
2019-08-17 23:01 ` Laurent Bercot [this message]
2019-08-18  4:09   ` Casper Ti. Vector
     [not found]   ` <20190818040925.yqy4nm7cwsnrtyjl@caspervector>
2019-08-18  6:26     ` Laurent Bercot
2019-08-18  8:34       ` Casper Ti. Vector
2019-08-18 16:18       ` Samuel Holland
2019-08-18 18:35         ` Laurent Bercot
2019-08-18 19:28           ` Guillermo
2019-08-18 20:36             ` Oliver Schad
2019-08-18 15:08   ` Guillermo
2019-08-18 21:36 ` Brett Neumeier

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=em288742c3-85c4-4256-aa86-c196ef57db87@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=supervision@list.skarnet.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;
as well as URLs for NNTP newsgroup(s).