summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-kmsg.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-kmsg.c
parentjournald: when create journal directories use calculated paths (diff)
downloadsystemd-b1852c48c12754f7d0e7705150b7f9488f34f4a9.tar.xz
systemd-b1852c48c12754f7d0e7705150b7f9488f34f4a9.zip
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-kmsg.c')
-rw-r--r--src/journal/journald-kmsg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index f1e9dee38e..ec404145ee 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -417,6 +417,7 @@ fail:
int server_open_kernel_seqnum(Server *s) {
_cleanup_close_ int fd = -1;
+ const char *fn;
uint64_t *p;
int r;
@@ -428,9 +429,10 @@ int server_open_kernel_seqnum(Server *s) {
if (!s->read_kmsg)
return 0;
- fd = open("/run/systemd/journal/kernel-seqnum", O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644);
+ fn = strjoina(s->runtime_directory, "/kernel-seqnum");
+ fd = open(fn, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644);
if (fd < 0) {
- log_error_errno(errno, "Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
+ log_error_errno(errno, "Failed to open %s, ignoring: %m", fn);
return 0;
}