On Friday 15 August 2014 at 15:35:06, Ivan Shapovalov wrote:    
> [...]
> > 
> > Ah, right. This is actually correct here. We want to make sure that the
> > root fs is remounted before we mount the other units, since this might
> > required creating additional directories to mount things on...
> > 
> > There are two more complications: 
> > 
> > a) if you want to make use of local-fs-pre.target you actually have to
> >    pull it in, it's a "passive" unit. See systemd.special(5).
> > 
> > b) You want to run your stuff before fsck is run on the devices, so that
> >    you don't end up interrupting an fsck that is half in progress.
> > 
> > To put this together, in your unit file you need:
> > 
> >     Before=local-fs-pre.target systemd-remount-fs.service 
> > systemd-fsck-root.service
> >     Wants=local-fs-pre.target
> > 
> > That should be enough. (You don't need to individually order the
> > systemd-fsck@.service instances for the other devices after your
> > service, since they are already ordered after systemd-fsck-root.service,
> > and you order yourself before that, so all is good).
> > 
> > Lennart
> 
> One more question. What about setups with no initrd and read-write rootfs?
> In such cases, the resume unit must silently skip itself.
> 
> ConditionPathIsReadWrite=!/ doesn't seem to be useful here: with initramfs
> this check will yield a false-negative.
> 
> This can be solved by introducing two resume units (say,
> systemd-resume@.service and initrd-resume@.service), first with
> 
>     Before=local-fs-pre.target systemd-remount-fs.service 
> systemd-fsck-root.service
>     Wants=local-fs-pre.target
>     ConditionPathIsReadWrite=!/
> 
> and the second one with
> 
>     ConditionPathExists=/etc/initrd-release
>     # something else ?
> 
> BTW... are you sure that the second variant (in initramfs) does not require 
> something
> to order before sysroot.mount and all fsck units?..

Actually, in case of initramfs these dependencies are not enough.

In case of initramfs, there is no apparent way to order before
all mounts and their fsck instances, especially given that there are no
equivalents of systemd-remount-fs.service and systemd-fsck-root.service.

Or do I miss something? Could you (someone) please give an advice?

I'm also uncertain whether having two units (for initramfs and for real root)
is the only way.

Thanks,
-- 
Ivan Shapovalov / intelfx /

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to