Red Hat Bugzilla – Bug 1009097
$local_fs dependencies in LSB init scripts are ignored by systemd
Last modified: 2013-09-17 14:30: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
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):
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.
Actual results: No dependency on local-fs.target
Expected results: A dependency on local-fs.target
Isn't there indirect ordering?:
your.service After basic.target After sysinit.target After local-fs.target
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.