Bug 1009097 - $local_fs dependencies in LSB init scripts are ignored by systemd
$local_fs dependencies in LSB init scripts are ignored by systemd
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-17 12:48 EDT by Andrew J. Schorr
Modified: 2013-09-17 14:30 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-17 14:30:00 EDT
Type: Bug
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 Andrew J. Schorr 2013-09-17 12:48:00 EDT
Description of problem: I have an LSB init script that declares a dependency on $local_fs in the Required-Start header.  But systemd ignores this. This commit removed that translation in src/core/service.c:sysv_translate_facility

http://cgit.freedesktop.org/systemd/systemd/commit/?id=5d4caf565471ff3401bd9b53aa814c8545a18a93

I think this can lead to a race condition when shutting down the system.
My script mounts 2 filesystems as part of its service startup.  When
shutdown occurs, I think there's a race condition where systemd may unmount
those filesystems itself before running the init script stop command.  The
script would like to unmount those filesystems itself after copying
some information from them.  I don't see any dependencies that would prevent
systemd from starting to unmount local filesystems before my service stop
script is run.

Version-Release number of selected component (if applicable):
systemd-204-11.fc19.x86_64


How reproducible: run "systemctl show" for an LSB init service with a dependency on $local_fs and note that the After value does not include local-fs.target


Steps to Reproduce:
1. Install an LSB init script with $local_fs in Required-Start
2. Observer 'systemctl show' contents of the After field.
3.

Actual results: No dependency on local-fs.target


Expected results: A dependency on local-fs.target


Additional info:
Comment 1 Michal Schmidt 2013-09-17 13:59:09 EDT
Isn't there indirect ordering?:
your.service After basic.target After sysinit.target After local-fs.target
Comment 2 Andrew J. Schorr 2013-09-17 14:30:00 EDT
I think you are correct.  I experienced this problem on Fedora 16, and was attempting to troubleshoot whether it would also occur on Fedora 19.  I failed
to see the indirect ordering.  In Fedora 16, I think the problem was that
the .mount units created did not specify Before=local-fs.target.  So perhaps
everything will work properly in Fedora 19.

I now see that I should have run "systemctl --after list-dependencies <service>"

Sorry for the bother.  I am closing this.

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