diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-07 23:40:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-07 23:40:00 +0200 |
commit | 182b858fc2e61e34cd9911c291580659b2cb72b4 (patch) | |
tree | 89d799eb5aa5e9caeaa6ad3c9765b5cfe2687b7b /src/journal/journald.c | |
parent | a1a03e3075316e2376176fc54c74e071adc9d71a (diff) |
journald: make splitting up of journal files per-user configurable
Diffstat (limited to 'src/journal/journald.c')
-rw-r--r-- | src/journal/journald.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c index 5d0d2033f2..a3167712bb 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -87,6 +87,15 @@ static const char* const storage_table[] = { DEFINE_STRING_TABLE_LOOKUP(storage, Storage); DEFINE_CONFIG_PARSE_ENUM(config_parse_storage, storage, Storage, "Failed to parse storage setting"); +static const char* const split_mode_table[] = { + [SPLIT_NONE] = "none", + [SPLIT_UID] = "uid", + [SPLIT_LOGIN] = "login" +}; + +DEFINE_STRING_TABLE_LOOKUP(split_mode, SplitMode); +DEFINE_CONFIG_PARSE_ENUM(config_parse_split_mode, split_mode, SplitMode, "Failed to parse split mode setting"); + static uint64_t available_space(Server *s) { char ids[33], *p; const char *f; @@ -659,7 +668,10 @@ static void dispatch_message_real( assert(n <= m); - write_to_journal(s, realuid == 0 ? 0 : loginuid, iovec, n); + write_to_journal(s, + s->split_mode == SPLIT_NONE ? 0 : + (s->split_mode == SPLIT_UID ? realuid : + (realuid == 0 ? 0 : loginuid)), iovec, n); free(pid); free(uid); |