]> err.no Git - systemd/commitdiff
core: switch all log targets to go directly to the journal, instead via syslog
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Jan 2012 04:09:06 +0000 (05:09 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Jan 2012 04:09:06 +0000 (05:09 +0100)
24 files changed:
man/systemd.xml
src/bridge.c
src/cgroups-agent.c
src/cryptsetup/cryptsetup-generator.c
src/getty-generator.c
src/initctl.c
src/login/user-sessions.c
src/main.c
src/manager.c
src/manager.h
src/modules-load.c
src/quotacheck.c
src/random-seed.c
src/rc-local-generator.c
src/readahead/readahead-collect.c
src/readahead/readahead-replay.c
src/remount-api-vfs.c
src/reply-password.c
src/shutdownd.c
src/system.conf
src/unit.c
src/update-utmp.c
units/fsck-root.service.in
units/fsck@.service.in

index c1766e26a46edc4ef94df9f7a02dae1733f5698a..121cb2126684b5c326b29305296a8254908ec5f5 100644 (file)
                                 <listitem><para>Set log
                                 target. Argument must be one of
                                 <option>console</option>,
+                                <option>journal</option>,
                                 <option>syslog</option>,
                                 <option>kmsg</option>,
+                                <option>journal-or-kmsg</option>,
                                 <option>syslog-or-kmsg</option>,
                                 <option>null</option>.</para></listitem>
                         </varlistentry>
                                 <option>inherit</option>,
                                 <option>null</option>,
                                 <option>tty</option>,
+                                <option>journal</option>,
+                                <option>journal+console</option>,
                                 <option>syslog</option>,
                                 <option>syslog+console</option>,
                                 <option>kmsg</option>,
                                 <option>kmsg+console</option>.  If the
                                 argument is omitted
                                 <option>--default-standard-output=</option>
-                                defaults to <option>syslog</option>
+                                defaults to <option>journal</option>
                                 and
                                 <option>--default-standard-error=</option>
                                 to
                         </varlistentry>
 
                         <varlistentry>
+                                <term>SIGRTMIN+26</term>
                                 <term>SIGRTMIN+27</term>
                                 <term>SIGRTMIN+28</term>
                                 <term>SIGRTMIN+29</term>
 
                                 <listitem><para>Sets the log level to
-                                <literal>console</literal>
-                                (resp. <literal>kmsg</literal> on
+                                <literal>journal-or-kmsg</literal>
+                                (resp. <literal>console</literal> on
+                                <literal>SIGRTMIN+27</literal>;
+                                resp. <literal>kmsg</literal> on
                                 <literal>SIGRTMIN+28</literal>;
                                 resp. <literal>syslog-or-kmsg</literal>
                                 on <literal>SIGRTMIN+29</literal>), as
                                 controlled via
-                                <varname>systemd.log_target=console</varname>
-                                (resp. <varname>systemd.log_target=kmsg</varname>
+                                <varname>systemd.log_target=journal-or-kmsg</varname>
+                                (resp. <varname>systemd.log_target=console</varname>
+                                on <literal>SIGRTMIN+27</literal>;
+                                resp. <varname>systemd.log_target=kmsg</varname>
                                 on <literal>SIGRTMIN+28</literal>;
                                 resp
                                 <varname>systemd.log_target=syslog-or-kmsg</varname>
 
                         </varlistentry>
 
-                        <varlistentry>
-                                <term><filename>/run/systemd/stdout-syslog-bridge</filename></term>
-
-                                <listitem><para>Used internally by the
-                                <filename>systemd-stdout-syslog-bridge.service</filename>
-                                unit to connect STDOUT and/or STDERR
-                                of spawned processes to
-                                <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
-                                or the kernel log buffer. This is an
-                                AF_UNIX stream
-                                socket.</para></listitem>
-                        </varlistentry>
-
                         <varlistentry>
                                 <term><filename>/run/systemd/shutdownd</filename></term>
 
index 878856cfd6e4123db297d489b013df45045f3754..1f7cf3a9b94dc6633f20425a68afbad05d2a4e09 100644 (file)
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
         log_parse_environment();
         log_open();
 
index 7f001e67d125fe5fc59a081e48751644d9b35102..1bbc8827d745c2a86d132c8f4904f44ed543f304 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index a48b7a45626abad773f2cf7c92871e0eafb13e59..ba59b49b014380ccb107fe885e69418981c636bd 100644 (file)
@@ -245,7 +245,7 @@ int main(int argc, char *argv[]) {
         if (argc > 1)
                 arg_dest = argv[1];
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 6b5b254e6abe51198a46a4b5ecb864045625cd4d..1263785fb51127d646fc11495ec5d03d57d9c0ad 100644 (file)
@@ -103,7 +103,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index e2189e9ee171e8ccf0f997f823badff2c55d5116..53d03a9e10721f79efe2d6a3dd8d44698bfda517 100644 (file)
@@ -388,7 +388,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index df46b76c872842597597e1661da4b7e29ec1a329..64aa3bb1c662db8ba7cbce9732483ad59bfd0059 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char*argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index b23dd18f93b581e7b83e364dea491d36e0bb1336..91516dad5afccdcfe900ba1c0793a59fb9653a7e 100644 (file)
@@ -343,7 +343,7 @@ static int parse_proc_cmdline_word(const char *word) {
 #ifdef HAVE_SYSV_COMPAT
                          "systemd.sysv_console=0|1                 Connect output of SysV scripts to console\n"
 #endif
-                         "systemd.log_target=console|kmsg|syslog|syslog-or-kmsg|null\n"
+                         "systemd.log_target=console|kmsg|journal|journal-or-kmsg|syslog|syslog-or-kmsg|null\n"
                          "                                         Log target\n"
                          "systemd.log_level=LEVEL                  Log level\n"
                          "systemd.log_color=0|1                    Highlight important log messages\n"
@@ -993,7 +993,7 @@ static int help(void) {
 #ifdef HAVE_SYSV_COMPAT
                "     --sysv-console[=0|1]        Connect output of SysV scripts to console\n"
 #endif
-               "     --log-target=TARGET         Set log target (console, syslog, kmsg, syslog-or-kmsg, null)\n"
+               "     --log-target=TARGET         Set log target (console, journal, syslog, kmsg, journal-or-kmsg, syslog-or-kmsg, null)\n"
                "     --log-level=LEVEL           Set log level (debug, info, notice, warning, err, crit, alert, emerg)\n"
                "     --log-color[=0|1]           Highlight important log messages\n"
                "     --log-location[=0|1]        Include code location in log messages\n"
@@ -1177,7 +1177,7 @@ int main(int argc, char *argv[]) {
 
         if (getpid() == 1) {
                 arg_running_as = MANAGER_SYSTEM;
-                log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_SYSLOG_OR_KMSG);
+                log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_JOURNAL_OR_KMSG);
 
                 if (!is_reexec)
                         if (selinux_setup(&loaded_policy) < 0)
index 54df7ebe5f94a2bfdc83f5e260a28e8978100e34..a549209ca6481c13bf09e07dd27adb81f083a511 100644 (file)
@@ -195,6 +195,7 @@ static int manager_setup_signals(Manager *m) {
                         SIGRTMIN+21, /* systemd: disable status messages */
                         SIGRTMIN+22, /* systemd: set log level to LOG_DEBUG */
                         SIGRTMIN+23, /* systemd: set log level to LOG_INFO */
+                        SIGRTMIN+26, /* systemd: set log target to journal-or-kmsg */
                         SIGRTMIN+27, /* systemd: set log target to console */
                         SIGRTMIN+28, /* systemd: set log target to kmsg */
                         SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg */
@@ -2293,6 +2294,11 @@ static int manager_process_signal_fd(Manager *m) {
                                 log_notice("Setting log level to info.");
                                 break;
 
+                        case 26:
+                                log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
+                                log_notice("Setting log target to journal-or-kmsg.");
+                                break;
+
                         case 27:
                                 log_set_target(LOG_TARGET_CONSOLE);
                                 log_notice("Setting log target to console.");
@@ -3121,7 +3127,7 @@ int manager_set_default_controllers(Manager *m, char **controllers) {
         return 0;
 }
 
-void manager_recheck_syslog(Manager *m) {
+void manager_recheck_journal(Manager *m) {
         Unit *u;
 
         assert(m);
@@ -3131,13 +3137,13 @@ void manager_recheck_syslog(Manager *m) {
 
         u = manager_get_unit(m, SPECIAL_JOURNALD_SOCKET);
         if (u && SOCKET(u)->state != SOCKET_RUNNING) {
-                log_close_syslog();
+                log_close_journal();
                 return;
         }
 
         u = manager_get_unit(m, SPECIAL_JOURNALD_SERVICE);
         if (u && SERVICE(u)->state != SERVICE_RUNNING) {
-                log_close_syslog();
+                log_close_journal();
                 return;
         }
 
index 6e7558e17558c3b69034671ee045f8229d0b6cf9..0ace0c9ffe1ef44b8225a4b61b317d5c8b23438b 100644 (file)
@@ -289,7 +289,7 @@ void manager_check_finished(Manager *m);
 void manager_run_generators(Manager *m);
 void manager_undo_generators(Manager *m);
 
-void manager_recheck_syslog(Manager *m);
+void manager_recheck_journal(Manager *m);
 
 void manager_set_show_status(Manager *m, bool b);
 bool manager_get_show_status(Manager *m);
index 8dd98f73d82482a30bd9945d8cab97ebf43e61d4..7384f25ab040487e6aff3b37e05d11aaac226728 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 60033a8eb256275c2df03b51b1cf4a5ad31cfde5..b6648b836960b800e4065845640c487e44bb5aea 100644 (file)
@@ -87,7 +87,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 0c63794b66839e7cb3fb6f97830ddfc1f003e17b..8b43bacadc67580f8657b1dc67b4ace6cf7effb1 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index ac6424a786531ae0e5936f011370579f1da8a980..56785cf40261f5a831ab8087114304b5126a7a18 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 6bff32f4dd0a1e8084f2b3af4c76faa6717fac18..7e6c243b5e1be0ddb5321df5a9558cc19c7bec4b 100644 (file)
@@ -654,7 +654,7 @@ int main(int argc, char *argv[]) {
         int r;
         const char *root;
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 88c7a219a8dd5fa04e4ebd353d4818c2883943ea..00d57c3d7ab5bdf3ed78599c19f3a43db0009b8f 100644 (file)
@@ -338,7 +338,7 @@ int main(int argc, char*argv[]) {
         int r;
         const char *root;
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 7b146551a80130c07da482f06e0f65b4f3fe114a..3e146ebb5c168e4aa57ba7f56b45805119a46fbd 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index bd55e65f3c3450165d0de6650e3cb38f8580d91f..3a96049d7f8d767176b9c6c6791a899fcd09dd5c 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) {
         char packet[LINE_MAX];
         size_t length;
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 19b16cbe39e366ec4c5ca275a6174786db2147ad..b4052d4933b94b241d5927fa41934e07abc30e68 100644 (file)
@@ -189,7 +189,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 2d1dd8669b1c3506c0920c98d15553a69225c354..33d09bccea6cab1fa386bf4f05e2fb8c9643e0bf 100644 (file)
@@ -9,7 +9,7 @@
 
 [Manager]
 #LogLevel=info
-#LogTarget=syslog-or-kmsg
+#LogTarget=journal-or-kmsg
 #LogColor=yes
 #LogLocation=no
 #DumpCore=yes
index e07d2c15d2788f184d6b0c50d4d93718a2909fec..1fbfb1dea5fb7df643f04ed5d46b1abe1c171c77 100644 (file)
@@ -1338,7 +1338,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
                 }
         }
 
-        manager_recheck_syslog(u->meta.manager);
+        manager_recheck_journal(u->meta.manager);
 
         /* Maybe we finished startup and are now ready for being
          * stopped because unneeded? */
index 073f28e2544478ffb6cadeece26e67bad977102b..0d177d61645d56f7ebd37ff8e78349cf2818bd2b 100644 (file)
@@ -369,7 +369,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
+        log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
index 7b3529db07e71a97ac8fe99148214949bb6652b5..408614912875322094912ec6b0474ade0bc62c8e 100644 (file)
@@ -18,6 +18,6 @@ ConditionPathExists=!/run/initramfs/root-fsck
 Type=oneshot
 RemainAfterExit=no
 ExecStart=@rootlibexecdir@/systemd-fsck
-StandardOutput=syslog+console
+StandardOutput=journal+console
 FsckPassNo=1
 TimeoutSec=0
index e1f773639bfd88a573482a5493d1e863140b8862..c06684b634c36215647011830f306ad5e22b8f48 100644 (file)
@@ -16,5 +16,5 @@ Before=shutdown.target
 Type=oneshot
 RemainAfterExit=no
 ExecStart=@rootlibexecdir@/systemd-fsck %f
-StandardOutput=syslog+console
+StandardOutput=journal+console
 TimeoutSec=0