summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-remote-main.c
diff options
context:
space:
mode:
authorberenddeschouwer <berend.de.schouwer@gmail.com>2022-12-17 14:54:16 +0100
committerGitHub <noreply@github.com>2022-12-17 14:54:16 +0100
commitf12b399dd6362a03379cb769954ebfb9972236ed (patch)
tree30edd6307366625b1f4e4165dae69eeaa703da05 /src/journal-remote/journal-remote-main.c
parentMerge pull request #25221 from enr0n/nic-rename-fallback (diff)
downloadsystemd-f12b399dd6362a03379cb769954ebfb9972236ed.tar.xz
systemd-f12b399dd6362a03379cb769954ebfb9972236ed.zip
vacuum journal remote (#25076)
* Support vacuuming for journal-remote Co-authored-by: Berend De Schouwer <berend@deschouwer.co.za>
Diffstat (limited to 'src/journal-remote/journal-remote-main.c')
-rw-r--r--src/journal-remote/journal-remote-main.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
index 440aad1cf7..476c9ad972 100644
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -53,6 +53,11 @@ static bool arg_trust_all = false;
static bool arg_trust_all = true;
#endif
+static uint64_t arg_max_use = UINT64_MAX;
+static uint64_t arg_max_size = UINT64_MAX;
+static uint64_t arg_n_max_files = UINT64_MAX;
+static uint64_t arg_keep_free = UINT64_MAX;
+
STATIC_DESTRUCTOR_REGISTER(arg_gnutls_log, strv_freep);
STATIC_DESTRUCTOR_REGISTER(arg_key, freep);
STATIC_DESTRUCTOR_REGISTER(arg_cert, freep);
@@ -759,11 +764,15 @@ static int negative_fd(const char *spec) {
static int parse_config(void) {
const ConfigTableItem items[] = {
- { "Remote", "Seal", config_parse_bool, 0, &arg_seal },
- { "Remote", "SplitMode", config_parse_write_split_mode, 0, &arg_split_mode },
- { "Remote", "ServerKeyFile", config_parse_path, 0, &arg_key },
- { "Remote", "ServerCertificateFile", config_parse_path, 0, &arg_cert },
- { "Remote", "TrustedCertificateFile", config_parse_path, 0, &arg_trust },
+ { "Remote", "Seal", config_parse_bool, 0, &arg_seal },
+ { "Remote", "SplitMode", config_parse_write_split_mode, 0, &arg_split_mode },
+ { "Remote", "ServerKeyFile", config_parse_path, 0, &arg_key },
+ { "Remote", "ServerCertificateFile", config_parse_path, 0, &arg_cert },
+ { "Remote", "TrustedCertificateFile", config_parse_path, 0, &arg_trust },
+ { "Remote", "MaxUse", config_parse_iec_uint64, 0, &arg_max_use },
+ { "Remote", "MaxFileSize", config_parse_iec_uint64, 0, &arg_max_size },
+ { "Remote", "MaxFiles", config_parse_uint64, 0, &arg_n_max_files },
+ { "Remote", "KeepFree", config_parse_iec_uint64, 0, &arg_keep_free },
{}
};
@@ -1136,6 +1145,12 @@ static int run(int argc, char **argv) {
s.check_trust = !arg_trust_all;
}
+ journal_reset_metrics(&s.metrics);
+ s.metrics.max_use = arg_max_use;
+ s.metrics.max_size = arg_max_size;
+ s.metrics.max_size = arg_keep_free;
+ s.metrics.n_max_files = arg_n_max_files;
+
r = create_remoteserver(&s, key, cert, trust);
if (r < 0)
return r;