which combines sigbus_install() and bumping fd limit.
#include "journal-util.h"
#include "json-util.h"
#include "log.h"
+#include "logs-show.h"
#include "macro.h"
#include "main-func.h"
#include "mount-util.h"
#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"
setlocale(LC_ALL, "");
log_setup();
- /* The journal merging logic potentially needs a lot of fds. */
- (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
-
r = parse_argv(argc, argv);
if (r <= 0)
return r;
- sigbus_install();
+ journal_browse_prepare();
units_active = check_units_active(); /* error is treated the same as 0 */
#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"
if (r <= 0)
return r;
- sigbus_install();
+ journal_browse_prepare();
+
assert_se(sigaction(SIGTERM, &sigterm, NULL) >= 0);
r = setup_gnutls_logger(NULL);
#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"
#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"
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;
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)
#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"
#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"
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;
if (r <= 0)
return r;
- sigbus_install();
+ journal_browse_prepare();
r = setup_uploader(&u, arg_url, arg_save_state);
if (r < 0)
#include "parse-argument.h"
#include "pretty-print.h"
#include "qrcode-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "sysctl-util.h"
#include "terminal-util.h"
log_setup();
- sigbus_install();
-
r = parse_argv(argc, argv);
if (r <= 0)
return r;
+ journal_browse_prepare();
+
r = acquire_first_emergency_log_message(&message);
if (r < 0)
return r;
#include "journalctl-util.h"
#include "logs-show.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "strv.h"
#include "terminal-util.h"
assert(ret);
- /* Increase max number of open files if we can, we might needs this when browsing journal files, which might be
- * split up into many files. */
- (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
-
- sigbus_install();
+ journal_browse_prepare();
if (arg_directory)
r = sd_journal_open_directory(&j, arg_directory, arg_journal_type | arg_journal_additional_open_flags);
#include "pretty-print.h"
#include "process-util.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "string-table.h"
#include "strv.h"
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 = parse_argv(argc, argv);
if (r <= 0)
return r;
+ journal_browse_prepare();
+
r = bus_connect_transport(arg_transport, arg_host, RUNTIME_SCOPE_SYSTEM, &bus);
if (r < 0)
return bus_log_connect_error(r, arg_transport);
#include "process-util.h"
#include "ptyfwd.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "sort-util.h"
#include "stdio-util.h"
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 = parse_argv(argc, argv);
if (r <= 0)
return r;
+ journal_browse_prepare();
+
if (STRPTR_IN_SET(argv[optind],
"import-tar", "import-raw", "import-fs",
"export-tar", "export-raw",
#include <getopt.h>
#include "build.h"
+#include "logs-show.h"
#include "main-func.h"
#include "networkctl.h"
#include "networkctl-address-label.h"
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
-#include "sigbus.h"
#include "verbs.h"
PagerFlags arg_pager_flags = 0;
log_setup();
- sigbus_install();
-
r = parse_argv(argc, argv);
if (r <= 0)
return r;
+ journal_browse_prepare();
+
return networkctl_main(argc, argv);
}
#include "macro.h"
#include "output-mode.h"
+#include "rlimit-util.h"
#include "set.h"
+#include "sigbus.h"
#include "time-util.h"
typedef struct LogId {
advance_older, max_ids,
ret_ids, ret_n_ids);
}
+
+static inline void journal_browse_prepare(void) {
+ /* Increase max number of open files if we can, we might needs this when browsing journal files,
+ * which might be split up into many files. */
+ (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
+
+ sigbus_install();
+}
#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"
#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"
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"