summaryrefslogtreecommitdiff
path: root/src/shared/log.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-22 22:00:37 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-22 22:00:37 +0200
commita6903061530cac5fbaa99a080a93221c02c349f9 (patch)
tree63eea46db06faef4b04fd81b00596d40ac800abd /src/shared/log.c
parent399c5f96331ad5281fdb75a7c0c66cc703f7eeb6 (diff)
log: make sure generators never log into the journal to avoid activation deadlocks
This makes all generators log to kmsg by default.
Diffstat (limited to 'src/shared/log.c')
-rw-r--r--src/shared/log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shared/log.c b/src/shared/log.c
index da5309888c..6a10dc4540 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -240,7 +240,7 @@ int log_open(void) {
return 0;
}
- if (log_target != LOG_TARGET_AUTO ||
+ if ((log_target != LOG_TARGET_AUTO && log_target != LOG_TARGET_SAFE) ||
getpid() == 1 ||
isatty(STDERR_FILENO) <= 0) {
@@ -266,6 +266,7 @@ int log_open(void) {
}
if (log_target == LOG_TARGET_AUTO ||
+ log_target == LOG_TARGET_SAFE ||
log_target == LOG_TARGET_JOURNAL_OR_KMSG ||
log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
log_target == LOG_TARGET_KMSG) {
@@ -547,6 +548,7 @@ static int log_dispatch(
if (k <= 0 &&
(log_target == LOG_TARGET_AUTO ||
+ log_target == LOG_TARGET_SAFE ||
log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
log_target == LOG_TARGET_JOURNAL_OR_KMSG ||
log_target == LOG_TARGET_KMSG)) {
@@ -744,6 +746,7 @@ static const char *const log_target_table[] = {
[LOG_TARGET_SYSLOG] = "syslog",
[LOG_TARGET_SYSLOG_OR_KMSG] = "syslog-or-kmsg",
[LOG_TARGET_AUTO] = "auto",
+ [LOG_TARGET_SAFE] = "safe",
[LOG_TARGET_NULL] = "null"
};