chiark / gitweb /
service: pull in sysv facility targets from the sysv units, not the other way round
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Mar 2011 04:26:25 +0000 (05:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Mar 2011 04:26:25 +0000 (05:26 +0100)
For an explanation see:

http://lists.freedesktop.org/archives/systemd-devel/2011-March/001692.html

TODO
src/service.c

diff --git a/TODO b/TODO
index 297d616e8d2d825c20ac184b4f8c2b91f31b51be..4916da2b633ad5d178b763957acb1f754ae46aa6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -25,6 +25,8 @@ F15:
 
 * NM should pull in network.target, ntpd should pull in rtc-set.target.
 
+* fix sysv parser to add right wants dependencies
+
 * document default dependencies
 
 Features:
index f0c72f2c2712c94779f689ef3e14274a405a303f..1735a96c80b930844d9d24d2d94e4d63692ed24e 100644 (file)
@@ -655,16 +655,21 @@ static int service_load_sysv_path(Service *s, const char *path) {
 
                                         if (unit_name_to_type(m) == UNIT_SERVICE)
                                                 r = unit_add_name(u, m);
-                                        else {
-                                                r = unit_add_dependency_by_name(u, UNIT_BEFORE, m, NULL, true);
-
-                                                if (s->sysv_enabled) {
-                                                        int k;
-
-                                                        if ((k = unit_add_dependency_by_name_inverse(u, UNIT_WANTS, m, NULL, true)) < 0)
-                                                                r = k;
-                                                }
-                                        }
+                                        else
+                                                /* NB: SysV targets
+                                                 * which are provided
+                                                 * by a service are
+                                                 * pulled in by the
+                                                 * services, as an
+                                                 * indication that the
+                                                 * 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)
                                                 log_error("[%s:%u] Failed to add LSB Provides name %s, ignoring: %s", path, line, m, strerror(-r));