[systemd-devel] Question about system-update.target

Lennart Poettering lennart at poettering.net
Mon Apr 27 07:18:04 PDT 2015


On Mon, 27.04.15 09:52, Richard Hughes (hughsient at gmail.com) wrote:

> At the moment the only user of system-update.target is PackageKit,
> which does package updates offline in the special system-update boot
> target. The other project that has just started using this mode is
> fwupd, which is using it to update BIOS-based firmware (not UEFI
> capsules) offline.
> 
> I've installed a symlink to system-update.target.wants so that the
> fwupd process gets run, but I'm a little worried about what happens
> when there are two optional services being run, both with
> OnFailure=reboot.target

Well, thinking about this, maybe OnFailure=reboot.target is missing
the point for these services. After all, the system should reboot
regardless if the update fails or not...

So maybe add a service systemd-update-post.service or so, that uses:

    [Service]
    Type=oneshot
    ExecStart=/bin/systemctl reboot --no-block

Then make sure that all your update services are of Type=oneshot
themselves and use Before=system-update-post.service and
Wants=system-update-post.service?

This would mean that any updating service would pull this in, and
order itself before it. Sicne this new service is hence ordered efter
each updating service it will only run after all of them finished,
regardless if failed or succeeded.

Does this make sense to you?

If so, we could probably add system-update-post.service as a standard
service to systemd itself.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list