service: pull in sysv facility targets from the sysv units, not the other way round
For an explanation see: http://lists.freedesktop.org/archives/systemd-devel/2011-March/001692.html
This commit is contained in:
parent
a0e155d440
commit
9700edb4e8
2
TODO
2
TODO
|
@ -25,6 +25,8 @@ F15:
|
||||||
|
|
||||||
* NM should pull in network.target, ntpd should pull in rtc-set.target.
|
* NM should pull in network.target, ntpd should pull in rtc-set.target.
|
||||||
|
|
||||||
|
* fix sysv parser to add right wants dependencies
|
||||||
|
|
||||||
* document default dependencies
|
* document default dependencies
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -655,16 +655,21 @@ static int service_load_sysv_path(Service *s, const char *path) {
|
||||||
|
|
||||||
if (unit_name_to_type(m) == UNIT_SERVICE)
|
if (unit_name_to_type(m) == UNIT_SERVICE)
|
||||||
r = unit_add_name(u, m);
|
r = unit_add_name(u, m);
|
||||||
else {
|
else
|
||||||
r = unit_add_dependency_by_name(u, UNIT_BEFORE, m, NULL, true);
|
/* NB: SysV targets
|
||||||
|
* which are provided
|
||||||
if (s->sysv_enabled) {
|
* by a service are
|
||||||
int k;
|
* pulled in by the
|
||||||
|
* services, as an
|
||||||
if ((k = unit_add_dependency_by_name_inverse(u, UNIT_WANTS, m, NULL, true)) < 0)
|
* indication that the
|
||||||
r = k;
|
* generic service is
|
||||||
}
|
* now available. This
|
||||||
}
|
* is strictly
|
||||||
|
* one-way. The
|
||||||
|
* targets do NOT pull
|
||||||
|
* in the SysV
|
||||||
|
* services! */
|
||||||
|
r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, UNIT_WANTS, m, NULL, true);
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_error("[%s:%u] Failed to add LSB Provides name %s, ignoring: %s", path, line, m, strerror(-r));
|
log_error("[%s:%u] Failed to add LSB Provides name %s, ignoring: %s", path, line, m, strerror(-r));
|
||||||
|
|
Loading…
Reference in a new issue