[systemd-devel] Safe handling of root filesystem on shutdown

Lennart Poettering lennart at poettering.net
Thu Apr 12 03:56:21 PDT 2012


On Wed, 11.04.12 10:33, Daniel Drake (dsd at laptop.org) wrote:

> Now, in systemd-shutdown we reach mount_points_list_get() in umount.c,
> which does:
> 
>                 /* If we encounter a bind mount, don't try to remount
>                  * the source dir too early */
>                 skip_ro = !streq(root, "/");
> 
> Hence skip_ro gets set to 1 for our /
> 
> mount_points_list_remount_read_only() then ignores the / mount and
> leaves it as RW during shutdown.
> 
> I don't really understand the reasoning for the above behaviour of
> bind mounts. Would it be acceptable to special-case this condition if
> the path in question is / so that skip_ro does not get set? Or are
> there other options available?

I think I added this logic primarily to make the shutdown loop quiet.

However I must admit that that's just a guess and since my commit
message is disappointingly unconclusive about this I am a bit lost...

If you revert f3accc08, do things look good for you then? Do you get any
log spew on shutdown?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list