summaryrefslogtreecommitdiff
path: root/src/journal/journald-context.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-25 15:00:38 +0100
committerLennart Poettering <lennart@poettering.net>2020-01-31 15:01:18 +0100
commitb1852c48c12754f7d0e7705150b7f9488f34f4a9 (patch)
treed670d7a30e6c5dbe1c56597523775b7c7ad6f676 /src/journal/journald-context.c
parentd6f46470f562a4a6f13a97df3b884969a1acf173 (diff)
downloadsystemd-b1852c48c12754f7d0e7705150b7f9488f34f4a9.tar.gz
journald: allow running multiple instances of journald
If we do, we operate on a separate set of logs and runtime objects The namespace is configured via argv[1]. Fixes: #12123 Fixes: #10230 #9519 (These latter two issues ask for slightly different stuff, but the usecases generally can be solved by running separate instances of journald now, hence also declaring that as "Fixes:")
Diffstat (limited to 'src/journal/journald-context.c')
-rw-r--r--src/journal/journald-context.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/journal/journald-context.c b/src/journal/journald-context.c
index c2d8972355..bac67036b0 100644
--- a/src/journal/journald-context.c
+++ b/src/journal/journald-context.c
@@ -780,7 +780,9 @@ void client_context_acquire_default(Server *s) {
log_warning_errno(r, "Failed to acquire our own context, ignoring: %m");
}
- if (!s->pid1_context) {
+ if (!s->namespace && !s->pid1_context) {
+ /* Acquire PID1's context, but only if we are in non-namespaced mode, since PID 1 is only
+ * going to log to the non-namespaced journal instance. */
r = client_context_acquire(s, 1, NULL, NULL, 0, NULL, &s->pid1_context);
if (r < 0)