Am 26.08.2014 um 22:17 schrieb Ivan Shapovalov:
> This can be used to initiate a resume from hibernation by path to a swap
> device containing the hibernation image.
> 
> The respective templated unit is also added. It is instantiated using
> path to the desired resume device.

Really great stuff, this was really missing from systemd initrd. I only
saw this because of your posting to the arch-projects list, so I am late
to the party. Anyway, although this is commited to systemd.git, there's
no reason it can't still be improved.

> diff --git a/units/systemd-hibernate-res...@.service.in 
> b/units/systemd-hibernate-res...@.service.in
> new file mode 100644
> index 0000000..6db584d
> --- /dev/null
> +++ b/units/systemd-hibernate-res...@.service.in
> @@ -0,0 +1,20 @@
> +#  This file is part of systemd.
> +#
> +#  systemd is free software; you can redistribute it and/or modify it
> +#  under the terms of the GNU Lesser General Public License as published by
> +#  the Free Software Foundation; either version 2.1 of the License, or
> +#  (at your option) any later version.
> +
> +[Unit]
> +Description=Resume from hibernation using device %f
> +Documentation=man:systemd-hibernate-resume@.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.

> +Wants=local-fs-pre.target
> +After=%i.device
> +Before=local-fs-pre.target systemd-remount-fs.service 
> systemd-fsck-root.service

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?

What's the purpose of ordering this against systemd-fsck-root.service?
This service is not run in initrd ever, because it checks
'ConditionPathIsReadWrite=!/', which always fails in initrd.

> +ConditionPathExists=/etc/initrd-release

We should have and use ConditionInitrd=. I am surprised that this
doesn't exist, but it really should.


Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to