diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-11-25 15:00:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-01-31 15:01:18 +0100 |
commit | b1852c48c12754f7d0e7705150b7f9488f34f4a9 (patch) | |
tree | d670d7a30e6c5dbe1c56597523775b7c7ad6f676 /src/journal/journald-context.c | |
parent | d6f46470f562a4a6f13a97df3b884969a1acf173 (diff) | |
download | systemd-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.c | 4 |
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) |