[systemd-devel] Running a service *just* before unmounting filesystems

Lennart Poettering lennart at poettering.net
Thu Jun 21 08:11:41 UTC 2018


On Do, 21.06.18 09:33, Hans de Goede (hdegoede at redhat.com) wrote:

> > > Wants=system-update-pre.target
> > > After=system-update-pre.target
> > Yep, that sounds reasonable.
> 
> So one more question about this, as discussed in the pull-req,
> updates services being linked from system-update.target.wants
> now need a "After=system-update-pre.target" in their .service
> files. I plan to file bugs against the existing .service
> files there for this (*).
> 
> Will those service files potentially having
> After=system-update-pre.target
> on systems with an older systemd which does not have that
> target be a problem, or will systemd just ignore this?

It won't "ignore" it, but it's nonetheless OK and intended usage to
reference non-existing units with After= and Before=. Ordering against
non-existing units is totally fine. Even Wants= on non-existing units
is fine. Only if you set Requires= on a non-existing unit you will get
failures.

systemd will still create a unit object in memory for non-existing
units, but it hides them by default in systemctl output, except if you
pass "--all".

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list