SinksThe location of the output journal can be specified
- with or . For "active"
- sources, this option is required.
+ with or .
@@ -261,7 +260,8 @@
is used, based on the hostname of the other endpoint of a
connection.
- In case of "active" sources, the output file name must
+ In the case that "active" sources are given by the positional
+ arguments or option, the output file name must
always be given explicitly and only none
is allowed.
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 7201421d91..64b1105901 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -66,7 +66,7 @@ static int arg_seal = false;
static int http_socket = -1, https_socket = -1;
static char** arg_gnutls_log = NULL;
-static JournalWriteSplitMode arg_split_mode = JOURNAL_WRITE_SPLIT_HOST;
+static JournalWriteSplitMode arg_split_mode = _JOURNAL_WRITE_SPLIT_INVALID;
static char* arg_output = NULL;
static char *arg_key = NULL;
@@ -1492,9 +1492,17 @@ static int parse_argv(int argc, char *argv[]) {
return -EINVAL;
}
+ if (!IN_SET(arg_split_mode, JOURNAL_WRITE_SPLIT_NONE, _JOURNAL_WRITE_SPLIT_INVALID)) {
+ log_error("For active sources, only --split-mode=none is allowed.");
+ return -EINVAL;
+ }
+
arg_split_mode = JOURNAL_WRITE_SPLIT_NONE;
}
+ if (arg_split_mode == _JOURNAL_WRITE_SPLIT_INVALID)
+ arg_split_mode = JOURNAL_WRITE_SPLIT_HOST;
+
if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE && arg_output) {
if (is_dir(arg_output, true) > 0) {
log_error("For SplitMode=none, output must be a file.");