[systemd-devel] [PATCHv6 2/3] hibernate-resume: add a tool to write a device node's major:minor to /sys/power/resume.

Thomas Bächler thomas at archlinux.org
Wed Aug 27 00:35:45 PDT 2014


Am 27.08.2014 um 09:22 schrieb Ivan Shapovalov:
>>> +[Unit]
>>> +Description=Resume from hibernation using device %f
>>> +Documentation=man:systemd-hibernate-resume at .service(8)
>>> +DefaultDependencies=no
>>> +BindsTo=%i.device
>>
>> What's the purpose of BindsTo= as opposed to Requires= here. They are
>> both the same for a oneshot service, but the former is more confusing.
> 
> This is just because systemd-fsck at .service does the same. Seems like it's
> the "established usage", as Andrei says.

BindsTo=
           Configures requirement dependencies, very similar in style to
Requires=, however in addition to this behavior, it also declares that
this unit is stopped when any of the units listed suddenly disappears.

"Stopping" a oneshot unit makes no sense, that's why I find BindsTo
confusing. If systemd-fsck at .service does the same, then we should do the
same thing here.

>> The part of ordering this Before=local-fs-pre.target is so crucial, it
>> can't be stressed enough. If _anything_ writes to _any_ file system
>> before this service runs, your system is broken and your data is lost.
>> That said, are you sure that all services are properly ordered against
>> the target?
> 
> I've spent quite some time verifying this. The only thing not covered
> is usr.mount (not sysroot-usr.mount), but Lennart says any configuration
> with initramfs's /usr split off is broken.

I've never heard of such a configuration.

> (Yes, I assume that lvm2, mdadm/mdmon, dm-event and so on don't write
> to filesystems. If I'm wrong -- this needs to be fixed...)

They really shouldn't. And they may be required for resuming (you can
resume from swap on lvm on an encrypted container, which is a rather
common setup).

>>> +ConditionPathExists=/etc/initrd-release
>>
>> We should have and use ConditionInitrd=. I am surprised that this
>> doesn't exist, but it really should.
> 
> Would you accept a patch adding that (using in_initrd()) and converting
> all uses of ConditionPathExists=/etc/initrd-release to this new
> condition statement?

I am not the one to accept patches here, but I'd love to see this
implemented.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140827/b974292b/attachment.sig>


More information about the systemd-devel mailing list