[systemd-devel] x-initrd.mount + shutdown umount logic question

Colin Guthrie gmane at colin.guthr.ie
Mon Jun 17 12:16:14 PDT 2013


'Twas brillig, and Lennart Poettering at 17/06/13 19:49 did gyre and gimble:
> On Thu, 13.06.13 22:13, Colin Guthrie (gmane at colin.guthr.ie) wrote:
> 
>> Hi,
>>
>> If a mount has the x-initrd.mount option shouldn't it be excluded from
>> the umount loop during shutdown?
>>
>> I've looked at the code but I don't see where they would be excluded.
>>
>> The reason I ask is that a user asked to exclude certain paths from the
>> umount logic, but I didn't like the patch he presented which was very
>> specific and one I'd have to carry downstream (it was used for live
>> ISOs). I'm sure it could be solved in other ways too but one thought was
>> the above option, but while I can see it's use in the fstab generator, I
>> can't see where this info is used in the umounting spree where /usr and
>> / are excluded specifically rather than using the result of the
>> mount_in_initrd() function.
>>
>> Any thoughts?
> 
> Hmm, the final unmount loop at shutdown tries to brutally unmont
> everything it can that is listed in the kernel. It does not check
> fstab. x-initrd.mount is an fstab flag that the kernel doesn't know
> about, so we cannot easily check for that.

Cool, no worries.

> In general, if something shall be excluded from the umount loop the best
> is probably to simply pin it by keeping an fd to the mount open. I'd
> really prefer if the umount loop would stay as simple and robust as it
> can be.

Seems like a pretty reasonable goal.

> Judging by the cited bug report it appears to me that this is solely
> about cosmetics, so I wonder if could better find a cosmetic solution to
> a cosmetic problem, and simply not show this output by default, or
> something like that...

Again seems fine. Personally I don't really mind these errors, so I'm
not crazy fussed either way. I only suggested this flag after reading
the code and just thinking out loud - but I can see your argument too.

I think the error messages can be useful so excluding the errors would
seem a little wrong to me.

Does the kernel know about the nofail flag or is it fully userspace too?
(quick test suggests it's userspace only)

Only other suggestion would be to not log anything under /mnt, but
that's waaaaay too hacky for me.

I say just leave it as it is unless some other bright idea comes up.

Cheers

Col
-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list