shared/logs-show: introduce journal_browse_prepare()

which combines sigbus_install() and bumping fd limit.
This commit is contained in:
Mike Yuan
2024-08-22 20:33:22 +02:00
parent d71f138156
commit fad3feec12
11 changed files with 32 additions and 47 deletions
+3 -6
View File
@@ -11,6 +11,7 @@
#include "capsule-util.h"
#include "dissect-image.h"
#include "install.h"
#include "logs-show.h"
#include "main-func.h"
#include "mount-util.h"
#include "output-mode.h"
@@ -21,7 +22,6 @@
#include "process-util.h"
#include "reboot-util.h"
#include "rlimit-util.h"
#include "sigbus.h"
#include "signal-util.h"
#include "stat-util.h"
#include "string-table.h"
@@ -1263,15 +1263,12 @@ static int run(int argc, char *argv[]) {
setlocale(LC_ALL, "");
log_setup();
/* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
sigbus_install();
r = systemctl_dispatch_parse_argv(argc, argv);
if (r <= 0)
goto finish;
journal_browse_prepare();
if (proc_mounted() == 0)
log_full(arg_no_warn ? LOG_DEBUG : LOG_WARNING,
"%s%s/proc/ is not mounted. This is not a supported mode of operation. Please fix\n"