Bug 802770 - Systemd starts a "Requires" dependency on "start" but not on "restart"
Systemd starts a "Requires" dependency on "start" but not on "restart"
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
: 808724 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 09:23 EDT by Peter Rajnoha
Modified: 2012-06-05 19:10 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-29 06:33:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Rajnoha 2012-03-13 09:23:10 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):
systemd-43-2.fc18.x86_64

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

Actual results:
dm-event.service started and dm-event.socket not started

Expected results:
dm-event.socket should be started as well since it is a required dependency
Comment 1 Michal Schmidt 2012-04-16 19:59:21 EDT
*** Bug 808724 has been marked as a duplicate of this bug. ***
Comment 2 Michal Schmidt 2012-04-16 20:11:52 EDT
https://bugzilla.redhat.com/show_bug.cgi?id=808724#c4:
> 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.
Comment 3 Bill Nottingham 2012-04-19 11:51:14 EDT
Is this bug that would be exposed related to https://bugzilla.redhat.com/show_bug.cgi?id=753586#c21?
Comment 4 Michal Schmidt 2012-04-20 08:40:21 EDT
No, it is different.
I'm rewriting systemd's transaction code a bit. This bug should get fixed in the process.
Comment 5 Michal Schmidt 2012-04-20 11:20:24 EDT
Upstream fix:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=65304075249449a713b4e4842b8538ef4aa1c725
In depends on previous patches.
Comment 6 Fedora Update System 2012-05-18 19:38:19 EDT
systemd-44-9.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/systemd-44-9.fc17
Comment 7 Fedora Update System 2012-05-18 19:57:37 EDT
systemd-37-20.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/systemd-37-20.fc16
Comment 8 Fedora Update System 2012-05-19 14:33:31 EDT
Package systemd-44-9.fc17:
* 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:
https://admin.fedoraproject.org/updates/FEDORA-2012-8127/systemd-44-9.fc17
then log in and leave karma (feedback).
Comment 9 Fedora Update System 2012-05-29 06:33:58 EDT
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.
Comment 10 Fedora Update System 2012-06-05 19:10:56 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.