summaryrefslogtreecommitdiffstats
path: root/src/journal-remote
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-08-17 19:53:09 +0200
committerMike Yuan <me@yhndnzj.com>2024-08-22 20:33:22 +0200
commitfad3feec120f9ab1174d993ff80be70493cddaec (patch)
treecbf0ec5d3c5a123a68f60d9336ffb14eb7625eff /src/journal-remote
parentbasic/sigbus: use FOREACH_ELEMENT where appropriate, assert >= 0 for success (diff)
downloadsystemd-fad3feec120f9ab1174d993ff80be70493cddaec.tar.xz
systemd-fad3feec120f9ab1174d993ff80be70493cddaec.zip
shared/logs-show: introduce journal_browse_prepare()
which combines sigbus_install() and bumping fd limit.
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-gatewayd.c4
-rw-r--r--src/journal-remote/journal-remote-main.c9
-rw-r--r--src/journal-remote/journal-upload.c7
3 files changed, 7 insertions, 13 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index dd91f22923..73b22170e7 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -32,7 +32,6 @@
#include "os-util.h"
#include "parse-util.h"
#include "pretty-print.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "time-util.h"
#include "tmpfile-util.h"
@@ -1134,7 +1133,8 @@ static int run(int argc, char *argv[]) {
if (r <= 0)
return r;
- sigbus_install();
+ journal_browse_prepare();
+
assert_se(sigaction(SIGTERM, &sigterm, NULL) >= 0);
r = setup_gnutls_logger(NULL);
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
index 34d4062d4a..1cc978d383 100644
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -13,6 +13,7 @@
#include "fileio.h"
#include "journal-remote-write.h"
#include "journal-remote.h"
+#include "logs-show.h"
#include "main-func.h"
#include "memory-util.h"
#include "parse-argument.h"
@@ -20,7 +21,6 @@
#include "pretty-print.h"
#include "process-util.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "socket-netlink.h"
#include "socket-util.h"
@@ -1072,11 +1072,6 @@ static int run(int argc, char **argv) {
log_setup();
- /* The journal merging logic potentially needs a lot of fds. */
- (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
-
- sigbus_install();
-
r = parse_config();
if (r < 0)
return r;
@@ -1085,6 +1080,8 @@ static int run(int argc, char **argv) {
if (r <= 0)
return r;
+ journal_browse_prepare();
+
if (arg_listen_http || arg_listen_https) {
r = setup_gnutls_logger(arg_gnutls_log);
if (r < 0)
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index f6b9351907..eb36d03130 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -23,6 +23,7 @@
#include "journal-upload.h"
#include "journal-util.h"
#include "log.h"
+#include "logs-show.h"
#include "main-func.h"
#include "mkdir.h"
#include "parse-argument.h"
@@ -30,7 +31,6 @@
#include "pretty-print.h"
#include "process-util.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "string-util.h"
#include "strv.h"
@@ -766,9 +766,6 @@ static int run(int argc, char **argv) {
log_setup();
- /* The journal merging logic potentially needs a lot of fds. */
- (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
-
r = parse_config();
if (r < 0)
return r;
@@ -777,7 +774,7 @@ static int run(int argc, char **argv) {
if (r <= 0)
return r;
- sigbus_install();
+ journal_browse_prepare();
r = setup_uploader(&u, arg_url, arg_save_state);
if (r < 0)