[systemd-commits] 2 commits - src/service.c TODO units/syslog.socket

Lennart Poettering lennart at kemper.freedesktop.org
Thu Mar 17 21:32:04 PDT 2011


 TODO                |    6 ++----
 src/service.c       |   25 +++++++++++++++----------
 units/syslog.socket |    3 +++
 3 files changed, 20 insertions(+), 14 deletions(-)

New commits:
commit 9700edb4e836f95815ee3237e5bc8d224b5014d7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Mar 18 05:26:25 2011 +0100

    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

diff --git a/TODO b/TODO
index 297d616..4916da2 100644
--- 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:
diff --git a/src/service.c b/src/service.c
index f0c72f2..1735a96 100644
--- a/src/service.c
+++ b/src/service.c
@@ -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));

commit a0e155d440173ba524918cb3800350b452952082
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Mar 18 05:17:02 2011 +0100

    units: pull in syslog.target from syslog.socket

diff --git a/TODO b/TODO
index 4191e55..297d616 100644
--- a/TODO
+++ b/TODO
@@ -23,11 +23,7 @@ F15:
 * 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
     (path: after installing inotify watches, recheck file again to fix race)
 
-* rsyslog.service should hook itself into syslog.target?
-
-* syslog.target should be pulled in by multi-user.target?
-
-* pull in .service from meta .targers AND vice versa too. i.e. syslog.target ←→ rsyslog.service, rpcbind similarly
+* NM should pull in network.target, ntpd should pull in rtc-set.target.
 
 * document default dependencies
 
diff --git a/units/syslog.socket b/units/syslog.socket
index d4bbc4d..500bb7c 100644
--- a/units/syslog.socket
+++ b/units/syslog.socket
@@ -12,6 +12,9 @@ Description=Syslog Socket
 DefaultDependencies=no
 Before=sockets.target syslog.target
 
+# Pull in syslog.target to tell people that /dev/log is now accessible
+Wants=syslog.target
+
 [Socket]
 ListenDatagram=/dev/log
 SocketMode=0666



More information about the systemd-commits mailing list