summaryrefslogtreecommitdiffstats
path: root/src/journal/journald-server.h
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-server.h
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-server.h')
-rw-r--r--src/journal/journald-server.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index a609e9db06..812c1eca8d 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -60,6 +60,8 @@ typedef struct JournalStorage {
} JournalStorage;
struct Server {
+ char *namespace;
+
int syslog_fd;
int native_fd;
int stdout_fd;
@@ -147,6 +149,8 @@ struct Server {
char machine_id_field[sizeof("_MACHINE_ID=") + 32];
char boot_id_field[sizeof("_BOOT_ID=") + 32];
char *hostname_field;
+ char *namespace_field;
+ char *runtime_directory;
/* Cached cgroup root, so that we don't have to query that all the time */
char *cgroup_root;
@@ -172,7 +176,7 @@ struct Server {
#define SERVER_MACHINE_ID(s) ((s)->machine_id_field + STRLEN("_MACHINE_ID="))
/* Extra fields for any log messages */
-#define N_IOVEC_META_FIELDS 22
+#define N_IOVEC_META_FIELDS 23
/* Extra fields for log messages that contain OBJECT_PID= (i.e. log about another process) */
#define N_IOVEC_OBJECT_FIELDS 18
@@ -204,7 +208,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_split_mode);
const char *split_mode_to_string(SplitMode s) _const_;
SplitMode split_mode_from_string(const char *s) _pure_;
-int server_init(Server *s);
+int server_init(Server *s, const char *namespace);
void server_done(Server *s);
void server_sync(Server *s);
int server_vacuum(Server *s, bool verbose);