[systemd-devel] Patches to use -.mount without /etc/fstab

Lennart Poettering lennart at poettering.net
Mon Sep 30 19:15:16 PDT 2013


On Tue, 24.09.13 13:53, Kelly Anderson (kelly at xilka.com) wrote:

> Hello,
> 
> If I'm not mistaken, the intent way back in the early stages of systemd was to 
> eliminate /etc/fstab and use .mount files exclusively.  Since it was never 
> fully implemented I took the prerogative to make it work on my systems.
> I've been using the setup for quite some time and it works without
> problem.

So, I am not really convinced that we really want to get rid of /etc/fstab...

> 1. if /etc/fstab is missing, systemd must remount / based on the options
> in /etc/systemd/system/-.mount.

This could be done by scheduling a reload job for -.mount. "systemctl
reload -- -.mount" should have the desired effect.

> 2.  If /etc/fstab is missing, systemd must create a valid fstab (in this case 
> /run/fstab) so that fsck runs properly.

Not following on this one really... If fsck fails if it doesn't find any
fstab, then this is really something to fix in util-linux I am sure. It
should treat a non-existant fstab the same way as an empty one.
 
> The attached patches address those issues.
> 

> +        if ( ! f ) {
> +                f = fopen("/etc/systemd/system/-.mount", "r");

This doesn't really work, as the unit file might at many other
places. Also, we really shouldn't process unit files anywhere except PID
1, and definitely not duplicate the code for it...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list