[systemd-commits] 4 commits - Makefile.am src/journal src/load-fragment.c src/main.c

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jan 6 16:26:32 PST 2012


 Makefile.am            |    6 ++++-
 src/journal/journald.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/load-fragment.c    |    6 ++++-
 src/main.c             |   16 +++++++-------
 4 files changed, 73 insertions(+), 10 deletions(-)

New commits:
commit 4ff77f66af8bd3e7e403c81febb7a2471457c5da
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jan 7 01:21:40 2012 +0100

    load-fragment: fix parsing of Socket= setting

diff --git a/src/load-fragment.c b/src/load-fragment.c
index 1903190..ef5d192 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1386,6 +1386,7 @@ int config_parse_socket_service(
         Socket *s = data;
         int r;
         DBusError error;
+        Unit *x;
 
         assert(filename);
         assert(lvalue);
@@ -1399,12 +1400,15 @@ int config_parse_socket_service(
                 return 0;
         }
 
-        if ((r = manager_load_unit(s->meta.manager, rvalue, NULL, &error, (Unit**) &s->service)) < 0) {
+        r = manager_load_unit(s->meta.manager, rvalue, NULL, &error, &x);
+        if (r < 0) {
                 log_error("[%s:%u] Failed to load unit %s, ignoring: %s", filename, line, rvalue, bus_error(&error, r));
                 dbus_error_free(&error);
                 return 0;
         }
 
+        unit_ref_set(&s->service, x);
+
         return 0;
 }
 

commit 509b6efbbe8d0486d33036892293c575bd4d0736
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jan 7 00:59:15 2012 +0100

    main: fix spelling

diff --git a/src/main.c b/src/main.c
index 575e5ea..b23dd18 100644
--- a/src/main.c
+++ b/src/main.c
@@ -270,7 +270,7 @@ static int parse_proc_cmdline_word(const char *word) {
                 int r;
 
                 if ((r = parse_boolean(word + 18)) < 0)
-                        log_warning("Failed to parse dump core switch %s, Ignoring.", word + 18);
+                        log_warning("Failed to parse dump core switch %s. Ignoring.", word + 18);
                 else
                         arg_dump_core = r;
 
@@ -278,7 +278,7 @@ static int parse_proc_cmdline_word(const char *word) {
                 int r;
 
                 if ((r = parse_boolean(word + 20)) < 0)
-                        log_warning("Failed to parse crash shell switch %s, Ignoring.", word + 20);
+                        log_warning("Failed to parse crash shell switch %s. Ignoring.", word + 20);
                 else
                         arg_crash_shell = r;
 
@@ -286,7 +286,7 @@ static int parse_proc_cmdline_word(const char *word) {
                 int r;
 
                 if ((r = parse_boolean(word + 22)) < 0)
-                        log_warning("Failed to parse confirm spawn switch %s, Ignoring.", word + 22);
+                        log_warning("Failed to parse confirm spawn switch %s. Ignoring.", word + 22);
                 else
                         arg_confirm_spawn = r;
 
@@ -294,7 +294,7 @@ static int parse_proc_cmdline_word(const char *word) {
                 int k;
 
                 if (safe_atoi(word + 19, &k) < 0)
-                        log_warning("Failed to parse crash chvt switch %s, Ignoring.", word + 19);
+                        log_warning("Failed to parse crash chvt switch %s. Ignoring.", word + 19);
                 else
                         arg_crash_chvt = k;
 
@@ -302,21 +302,21 @@ static int parse_proc_cmdline_word(const char *word) {
                 int r;
 
                 if ((r = parse_boolean(word + 20)) < 0)
-                        log_warning("Failed to parse show status switch %s, Ignoring.", word + 20);
+                        log_warning("Failed to parse show status switch %s. Ignoring.", word + 20);
                 else
                         arg_show_status = r;
         } else if (startswith(word, "systemd.default_standard_output=")) {
                 int r;
 
                 if ((r = exec_output_from_string(word + 32)) < 0)
-                        log_warning("Failed to parse default standard output switch %s, Ignoring.", word + 32);
+                        log_warning("Failed to parse default standard output switch %s. Ignoring.", word + 32);
                 else
                         arg_default_std_output = r;
         } else if (startswith(word, "systemd.default_standard_error=")) {
                 int r;
 
                 if ((r = exec_output_from_string(word + 31)) < 0)
-                        log_warning("Failed to parse default standard error switch %s, Ignoring.", word + 31);
+                        log_warning("Failed to parse default standard error switch %s. Ignoring.", word + 31);
                 else
                         arg_default_std_error = r;
 #ifdef HAVE_SYSV_COMPAT
@@ -324,7 +324,7 @@ static int parse_proc_cmdline_word(const char *word) {
                 int r;
 
                 if ((r = parse_boolean(word + 21)) < 0)
-                        log_warning("Failed to parse SysV console switch %s, Ignoring.", word + 20);
+                        log_warning("Failed to parse SysV console switch %s. Ignoring.", word + 20);
                 else
                         arg_sysv_console = r;
 #endif

commit effb1102d3f1d6bc2d0bda5328d3ce2139af9850
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jan 7 00:59:00 2012 +0100

    journald: introduce systemd_journald.forward_to_kmsg=1 (and friends) to enable kmsg forwarding globally via kernel cmdline

diff --git a/src/journal/journald.c b/src/journal/journald.c
index 53eef8b..1ec1542 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -47,6 +47,7 @@
 #include "journal-internal.h"
 #include "conf-parser.h"
 #include "journald.h"
+#include "virt.h"
 
 #define USER_JOURNALS_MAX 1024
 #define STDOUT_STREAMS_MAX 4096
@@ -2057,6 +2058,59 @@ static int open_signalfd(Server *s) {
         return 0;
 }
 
+static int server_parse_proc_cmdline(Server *s) {
+        char *line, *w, *state;
+        int r;
+        size_t l;
+
+        if (detect_container(NULL) > 0)
+                return 0;
+
+        r = read_one_line_file("/proc/cmdline", &line);
+        if (r < 0) {
+                log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
+                return 0;
+        }
+
+        FOREACH_WORD_QUOTED(w, l, line, state) {
+                char *word;
+
+                word = strndup(w, l);
+                if (!word) {
+                        r = -ENOMEM;
+                        goto finish;
+                }
+
+                if (startswith(word, "systemd_journald.forward_to_syslog=")) {
+                        r = parse_boolean(word + 35);
+                        if (r < 0)
+                                log_warning("Failed to parse forward to syslog switch %s. Ignoring.", word + 35);
+                        else
+                                s->forward_to_syslog = r;
+                } else if (startswith(word, "systemd_journald.forward_to_kmsg=")) {
+                        r = parse_boolean(word + 33);
+                        if (r < 0)
+                                log_warning("Failed to parse forward to kmsg switch %s. Ignoring.", word + 33);
+                        else
+                                s->forward_to_kmsg = r;
+                } else if (startswith(word, "systemd_journald.forward_to_console=")) {
+                        r = parse_boolean(word + 36);
+                        if (r < 0)
+                                log_warning("Failed to parse forward to console switch %s. Ignoring.", word + 36);
+                        else
+                                s->forward_to_console = r;
+                }
+
+                free(word);
+        }
+
+        r = 0;
+
+finish:
+        free(line);
+        return r;
+}
+
 static int server_parse_config_file(Server *s) {
         FILE *f;
         const char *fn;
@@ -2101,6 +2155,7 @@ static int server_init(Server *s) {
         memset(&s->runtime_metrics, 0xFF, sizeof(s->runtime_metrics));
 
         server_parse_config_file(s);
+        server_parse_proc_cmdline(s);
 
         s->user_journals = hashmap_new(trivial_hash_func, trivial_compare_func);
         if (!s->user_journals) {

commit a6723bc9a7af10b39b01d236bf7089816559c68d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jan 7 00:22:37 2012 +0100

    journald: start journald right away, don't wait until activation

diff --git a/Makefile.am b/Makefile.am
index bd7eb5c..2a7a38b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1353,10 +1353,14 @@ pkgconfiglib_DATA += \
 
 journal-install-data-hook:
 	$(MKDIR_P) -m 0755 \
-		$(DESTDIR)$(systemunitdir)/sockets.target.wants
+		$(DESTDIR)$(systemunitdir)/sockets.target.wants \
+		$(DESTDIR)$(systemunitdir)/sysinit.target.wants
 	( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
 		rm -f systemd-journald.socket && \
 		$(LN_S) ../systemd-journald.socket )
+	( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
+		rm -f systemd-journald.service && \
+		$(LN_S) ../systemd-journald.service )
 
 INSTALL_DATA_HOOKS += \
 	journal-install-data-hook



More information about the systemd-commits mailing list