Description of problem: The current version of mdmonitor-takeover.service says: [Unit] Description=Software RAID Monitor Takeover After=syslog.target [Service] Type=forking RemainAfterExit=yes ExecStart=/sbin/mdmon --takeover --all [Install] WantedBy=sysinit.target I do not know the exact intentions of the author of the unit file, but the fact that this unit installs itself into sysinit.target suggests that it is meant to run early during boot. However, since it defaults to DefaultDependencies=yes, it automatically gets a dependency After=basic.target (and a few more dependencies, see "man systemd.service" for details). If the intent is indeed to run this service in early boot before ordinary services, DefaultDependencies=no should be specified in the unit file. So far this inconsistency did not seem to cause actual problems, because it was hidden by a bug in systemd. When there is a requirement dependency between a target and another unit (such as: sysinit.target Wants mdmonitor-takeover.service), and both units have DefaultDependencies=yes, the dependency is supposed to be complemented automatically with ordering (sysinit.target After mdmonitor-takeover.service). This is documented in "man systemd.target", but it did not work until systemd-36. When systemd-36-2.fc16 with the fix was pushed to updates-testing, the problem with mdmonitor-takeover.service appeared. An ordering cycle was the result: sysinit.target -> mdmonitor-takeover.service -> basic.target -> sysinit.target I reverted the fix in systemd-36-3.fc16, but the revert is meant to be only temporary. The ordering inconsistency in mdmonitor-takeover.service should be fixed. Version-Release number of selected component (if applicable): mdadm-3.2.2-9.fc16.x86_64 How reproducible: 100% Steps to Reproduce: 1. Install systemd-36-2.fc16, make sure mdmonitor-takeover.service is enabled. 2. Reboot. Actual results: You will see bug 741078 or similar. Some services will not be started because they will be eliminated by ordering cycle resolution. mdmonitor-takeover.service will be mentioned in the ordering cycles in the logs. Expected results: A clean boot without ordering cycles. Additional info: Untested, but this should work: [Unit] Description=Software RAID Monitor Takeover After=syslog.target Before=sysinit.target shutdown.target Conflicts=shutdown.target DefaultDependencies=no [Service] Type=forking RemainAfterExit=yes ExecStart=/sbin/mdmon --takeover --all [Install] WantedBy=sysinit.target
> So far this inconsistency did not seem to cause actual problems, because it > was hidden by a bug in systemd. And that's why it was not found when testing mdadm unit files. It seems like simple bug in new service file. DefaultDependencies=no makes perfect sense here. (Doug, do you plan some mdadm rebuild? I think this is trivial change to add...)
Yes, there is likely to be an mdadm rebuild once a fix for another bug is identified.
Why doesn't systemd detect cycles like this? It seems very fragile if this kind of bug in an unrelated service can make the system near unrecoverable because services like dbus and NetworkManager fail to start.
(In reply to comment #3) > Why doesn't systemd detect cycles like this? It does. It breaks cycles by dropping a (pretty much randomly selected) member of the cycle. In https://bugzilla.redhat.com/show_bug.cgi?id=741078#c3 I showed an example where dbus.socket was the unfortunate victim.
Isn't it a cycle in a directed graph? Shouldn't the strategy be to drop the lowest node in the cycle, rather than a random node ? Or perhaps drop the node with the least dependencies up to that point? Somehow I think it should cause less damage than it did in this case.
Let's keep this BZ about the mdadm dependencies. I opened bug 742546 for the discussion about cycle breaking in systemd.
mdadm-3.2.2-11.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mdadm-3.2.2-11.fc16
Package mdadm-3.2.2-11.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mdadm-3.2.2-11.fc16' as soon as you are able to, then reboot. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-14682 then log in and leave karma (feedback).
mdadm-3.2.2-12.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mdadm-3.2.2-12.fc16
mdadm-3.2.2-12.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.