[systemd-commits] 2 commits - src/manager.c src/service.c src/update-utmp.c

Tollef Fog ☃ Heen tfheen at kemper.freedesktop.org
Mon Oct 17 12:06:05 PDT 2011


 src/manager.c     |    5 ++++-
 src/service.c     |    9 ++++++++-
 src/update-utmp.c |    5 ++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 5a8d081c58f7b83172ad5031a8fdac0c33072b2a
Author: Jonathan Nieder <jrnieder at gmail.com>
Date:   Mon Oct 17 21:01:40 2011 +0200

    audit: do not complain if kernel lacks audit
    
    When running on a kernel without audit support, systemd currently
    writes a mysterious-sounding error to its log:
    
    	systemd[1]: Failed to connect to audit log: Protocol not supported
    
    Better to suppress the audit_open() failure message when (and only
    when) it is due to running on a kernel without audit support, since in
    this case the admin probably does not mind systemd not writing to the
    audit log.  This way, more serious errors like ENOMEM and EACCES will
    stand out more.

diff --git a/src/manager.c b/src/manager.c
index 6d20258..111167a 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -286,7 +286,10 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
                 goto fail;
 
 #ifdef HAVE_AUDIT
-        if ((m->audit_fd = audit_open()) < 0)
+        if ((m->audit_fd = audit_open()) < 0 &&
+            /* If the kernel lacks netlink or audit support,
+             * don't worry about it. */
+            errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
                 log_error("Failed to connect to audit log: %m");
 #endif
 
diff --git a/src/update-utmp.c b/src/update-utmp.c
index f81e7f4..12e4d11 100644
--- a/src/update-utmp.c
+++ b/src/update-utmp.c
@@ -376,7 +376,10 @@ int main(int argc, char *argv[]) {
         umask(0022);
 
 #ifdef HAVE_AUDIT
-        if ((c.audit_fd = audit_open()) < 0)
+        if ((c.audit_fd = audit_open()) < 0 &&
+            /* If the kernel lacks netlink or audit support,
+             * don't worry about it. */
+            errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
                 log_error("Failed to connect to audit log: %m");
 #endif
 

commit e51db373c242b7541794affb2b5e411bcce26d0f
Author: Tollef Fog Heen <tfheen at err.no>
Date:   Mon Oct 17 21:00:42 2011 +0200

    service: Drop rcN.d runlevels from SysV services that also exist in rcS.d
    
    Services which claim to start in both rcN.d and rcS.d generate
    loops which for some reason seems to usually end up with dbus not
    starting and the whole machine being quite unhappy. We now rather
    assume that if a service can be started in rcS, it should not also
    start in rcN.d.
    
    Fixes Debian bug #637037

diff --git a/src/service.c b/src/service.c
index e64d289..6184390 100644
--- a/src/service.c
+++ b/src/service.c
@@ -83,7 +83,7 @@ static const struct {
 
 #define RUNLEVELS_UP "12345"
 /* #define RUNLEVELS_DOWN "06" */
-/* #define RUNLEVELS_BOOT "bBsS" */
+#define RUNLEVELS_BOOT "bBsS"
 #endif
 
 static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
@@ -811,6 +811,13 @@ static int service_load_sysv_path(Service *s, const char *path) {
 
         if ((r = sysv_exec_commands(s)) < 0)
                 goto finish;
+        if (s->sysv_runlevels &&
+            chars_intersect(RUNLEVELS_BOOT, s->sysv_runlevels) &&
+            chars_intersect(RUNLEVELS_UP, s->sysv_runlevels)) {
+                /* Service has both boot and "up" runlevels
+                   configured.  Kill the "up" ones. */
+                delete_chars(s->sysv_runlevels, RUNLEVELS_UP);
+        }
 
         if (s->sysv_runlevels && !chars_intersect(RUNLEVELS_UP, s->sysv_runlevels)) {
                 /* If there a runlevels configured for this service



More information about the systemd-commits mailing list