Am 11.01.2018 um 15:25 schrieb Uoti Urpala:
On Thu, 2018-01-11 at 10:59 +0000, 林自均 wrote:
I have 2 service unist: first.service and second.service. I
configured "After=first.service" in second.service. Both services are
"Type=oneshot".

If I execute:

# systemctl start first.service second.service

The ordering dependency will work, i.e. second.service will start
after first.service.

However, if I execute:

# systemctl start second.service first.service

first.service and second.service will start at the same time.

Is this behavior documented somewhere? Thanks!

I'd guess this is due to systemctl starting each listed unit
independently rather than as a single transaction. Thus, the second
version first starts second.service without first.service being active
at all. Since there's only an After relationship, not Wants/Requires,
second.service will immediately start. Then systemctl starts
first.service; since second.service is already running, there's nothing
the After relationship could affect

but why?

the one "After=" should be enough to have a clear ordering of stop/start both as it happens in shutdown/boot
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to