[systemd-devel] Implementing resume from hibernation as a systemd unit file

Lennart Poettering lennart at poettering.net
Wed Aug 20 16:03:20 PDT 2014


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.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list