log: never ever log to syslog from PID 1, log to the journal again
We don't support journal-less systems anyway, so let's avoid the confusion.
This commit is contained in:
+2
-1
@@ -1018,7 +1018,7 @@ static int help(void) {
|
||||
" --crash-shell[=0|1] Run shell on crash\n"
|
||||
" --confirm-spawn[=0|1] Ask for confirmation when spawning processes\n"
|
||||
" --show-status[=0|1] Show status updates on the console during bootup\n"
|
||||
" --log-target=TARGET Set log target (console, journal, syslog, kmsg, journal-or-kmsg, syslog-or-kmsg, null)\n"
|
||||
" --log-target=TARGET Set log target (console, journal, kmsg, journal-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"
|
||||
@@ -1328,6 +1328,7 @@ int main(int argc, char *argv[]) {
|
||||
saved_argc = argc;
|
||||
|
||||
log_show_color(isatty(STDERR_FILENO) > 0);
|
||||
log_set_upgrade_syslog_to_journal(true);
|
||||
|
||||
/* Disable the umask logic */
|
||||
if (getpid() == 1)
|
||||
|
||||
+2
-6
@@ -341,7 +341,7 @@ static int manager_setup_signals(Manager *m) {
|
||||
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 */
|
||||
SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg (obsolete)*/
|
||||
-1);
|
||||
assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
|
||||
|
||||
@@ -1731,6 +1731,7 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
|
||||
break;
|
||||
|
||||
case 26:
|
||||
case 29: /* compatibility: used to be mapped to LOG_TARGET_SYSLOG_OR_KMSG */
|
||||
log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
|
||||
log_notice("Setting log target to journal-or-kmsg.");
|
||||
break;
|
||||
@@ -1745,11 +1746,6 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
|
||||
log_notice("Setting log target to kmsg.");
|
||||
break;
|
||||
|
||||
case 29:
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_notice("Setting log target to syslog-or-kmsg.");
|
||||
break;
|
||||
|
||||
default:
|
||||
log_warning("Got unhandled signal <%s>.", signal_to_string(sfsi.ssi_signo));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user