Hello all, I have some trouble to understand how unit dependencies work when they change status. Suppose I have an ifup-all-auto.target (which will of course be created by a generator, but for experimentation I tried with a plain unit):
| [Unit] | Description=Wait until all "auto" ifupdown interfaces are up | Before=network-online.target | [email protected] | [email protected] | [email protected] | [email protected] | | [Install] | RequiredBy=network-online.target After booting, [email protected] succeeds (active (exited)) as eth0 actually exists and works etc. But eth42 does not exist, thus it's in state "failed (Result: exit-code)". Consequently, | $ sudo systemctl status ifup-all-auto.target -l | ● ifup-all-auto.target - Wait until all "auto" ifupdown interfaces are up | Loaded: loaded (/etc/systemd/system/ifup-all-auto.target; enabled; vendor preset: enabled) | Active: inactive (dead) | | Jan 14 09:34:58 autopkgtest systemd[1]: Dependency failed for Wait until all "auto" ifupdown interfaces are up. | Jan 14 09:34:58 autopkgtest systemd[1]: Job ifup-all-auto.target/start failed with result 'dependency'. (and obviously network-online.target is also in "dependency failed" state). So we have ifup@eth0 (SUCCESS) ifup@eth42 (FAIL) | | v v ifup-all-auto.target (DEP FAIL) | v network-online.target (DEP FAIL) So far so good. But now I make eth42 appear (simulating server situations where network interfaces just take a while to init) [1]. This causes [email protected] to get re-triggered via systemd's udev rules, thus the status changes to "active (exited)", i. e. "success". However, this doesn't seem to cause re-evaluation of the depending units: After that, ifup-all-auto.target (and network-online.target) are still in the same "dependency failed" state. Calling "systemctl start ifup-all-auto.target" manually updates the status, but at least in this case this should obviously happen automatically. Is this not how dependencies are supposed to work? If not, I suppose I rather need some active program in ifup-all-auto.target which waits for all expected interfaces to appear by itself? Or can I somehow cause the reverse dependencies of [email protected] to re-trigger? I didn't see anything obvious in the manpages. Thanks in advance for any insights! Martin [1] ip link add name eth42 type veth peer name veth42 -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
signature.asc
Description: Digital signature
_______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
