[systemd-devel] Implementing resume from hibernation as a systemd unit file
Ivan Shapovalov
intelfx100 at gmail.com
Thu Aug 21 16:03:31 PDT 2014
On Thursday 21 August 2014 at 01:03:20, Lennart Poettering wrote:
> On Tue, 19.08.14 15:46, Ivan Shapovalov (intelfx100 at gmail.com) wrote:
>
> > On Monday 18 August 2014 at 22:04:29, Ivan Shapovalov wrote:
> > > [..]
> > > > >
> > > > > Even if initramfs-only, ordering dependencies still need to be worked out.
> > > > > Inside of initramfs, neither systemd-fsck-root.service nor systemd-remount-fs.service
> > > > > do exist, so there's apparently nothing to reliably order against.
> > > >
> > > > Well, in the initrd the root dir is mounted to /sysroot, which means you
> > > > should be able to order yourself before sysroot.mount.
> > > >
> > > > Lennart
> > > >
> > > >
> > >
> > > ...missing sysroot's fsck, as well as any other x-initrd mounts and their fsck instances.
> > >
> > > Seems that sysroot.mount alone isn't sufficient.
> >
> > ...Anything on this?
> >
> > Should we add yet another passive target(s), something like fsck-pre? I don't
> > actually know what is the best way to tackle this. The resume unit shall be
> > activated before any writes to any block devices, including fsck, cryptsetup
> > and whatever else.
>
> Hmm, so I though a bit about this, and I think we should make the
> following changes to systemd:
>
> a) move local-fs-pre.target before all the fsck. This way we can make
> use of it as a barrier against modifications of any fs.
>
>
> b) introduce initrd-fs-pre.target that then plays a similar role, but in
> the initrd.
>
> A service that wants to run before any fs is touched should then order
> itself before both and everything should be good.
>
> If this makes sense, I would be happy to take a patch.
>
> I'd be willing to merge a good patch for a generator + mini-tool that
> parse the resume= option into systemd as well, btw.
So I have the prototype ready, but it seems that udevd indirectly depends
on remounting / read-write.
systemd-remount-fs.service -> systemd-sysusers.service -> systemd-udevd.service
This breaks the idea at least in the initramfs-less case (and also in the
pathological case of including systemd-sysusers.service into initramfs).
What would you suggest?
--
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140822/feebf73c/attachment.sig>
More information about the systemd-devel
mailing list