Red Hat Bugzilla – Bug 802770
Systemd starts a "Requires" dependency on "start" but not on "restart"
Last modified: 2012-06-05 19:10:56 EDT
Description of problem:
While having a dependency between units defined by the "Requires" tag, the dependency is started automatically on "systemctl start", but it's not started on "systemctl restart" if they're not running yet.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. considering two units (e.g. dm-event.socket and dm-event.service which has Requires=dm-event.socket and After=dm-event.socket)
2. systemctl stop dm-event.service dm-event.socket
3. systemctl restart dm-event.service
dm-event.service started and dm-event.socket not started
dm-event.socket should be started as well since it is a required dependency
*** Bug 808724 has been marked as a duplicate of this bug. ***
> Looks like we need to add dependency jobs for JOB_RESTART in
> transaction_add_job_and_dependencies(), the same as "type == JOB_START" has.
It's the right thing to do, but it will expose a bug:
If A.service requires B.service, both are running, and the user requests a restart of B.service, the following jobs will be added:
B.service/restart (the anchor)
A.service/restart (dependency from B's UNIT_REQUIRED_BY)
B.service/start (dependency from A's UNIT_REQUIRES)
B.service/restart and B.service/start will be merged, but unfortunately the one that gets deleted is the anchor. systemctl will not notice the completion of the job.
Is this bug that would be exposed related to https://bugzilla.redhat.com/show_bug.cgi?id=753586#c21?
No, it is different.
I'm rewriting systemd's transaction code a bit. This bug should get fixed in the process.
In depends on previous patches.
systemd-44-9.fc17 has been submitted as an update for Fedora 17.
systemd-37-20.fc16 has been submitted as an update for Fedora 16.
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-44-9.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
systemd-44-12.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
systemd-37-25.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.