Fix for anacron (running on resume under systemd)

Michael Biebl biebl at debian.org
Mon Dec 29 13:09:08 GMT 2014


Hi Ivo,

I see that you uploaded a fix for #744753, using a unit file called
anacron-resume:

> [Unit]
> Description=Run anacron jobs at resume
> After=suspend.target
> After=hibernate.target
> After=hybrid-sleep.target
> 
> [Service]
> ExecStart=/bin/systemctl --no-block --fail start anacron.service
> 
> [Install]
> WantedBy=suspend.target
> WantedBy=hibernate.target
> WantedBy=hybrid-sleep.target


I don't think, this fixes the issue in a proper way, because ordering
that service "After=suspend.target", doesn't mean the unit is actually
run on resume.

Take a look at systemd-suspend.service, which is responsible for putting
the system to sleep:

> [Unit]
> Description=Suspend
> Documentation=man:systemd-suspend.service(8)
> DefaultDependencies=no
> Requires=sleep.target
> After=sleep.target
> 
> [Service]
> Type=oneshot
> ExecStart=/lib/systemd/systemd-sleep suspend


It *also* has After=sleep.target.

That means, depending on the timing, anacron-resume.service might be
triggered just before suspend not on resume, and it's not guaranteed
that anacron has finished before systemd-sleep is called.

I don't think the patch was intended this way?

Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- 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.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20141229/fe6eb02b/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list