journald-server.c revision 6203e07a83214a55bb1f88508fcda2005c601dea
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2011 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#define DEFAULT_SYNC_INTERVAL_USEC (5*USEC_PER_MINUTE)
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#define DEFAULT_RATE_LIMIT_INTERVAL (30*USEC_PER_SEC)
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering#define RECHECK_AVAILABLE_SPACE_USEC (30*USEC_PER_SEC)
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poetteringstatic const char* const storage_table[] = {
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart PoetteringDEFINE_STRING_TABLE_LOOKUP(storage, Storage);
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart PoetteringDEFINE_CONFIG_PARSE_ENUM(config_parse_storage, storage, Storage, "Failed to parse storage setting");
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poetteringstatic const char* const split_mode_table[] = {
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart PoetteringDEFINE_STRING_TABLE_LOOKUP(split_mode, SplitMode);
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart PoetteringDEFINE_CONFIG_PARSE_ENUM(config_parse_split_mode, split_mode, SplitMode, "Failed to parse split mode setting");
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poetteringstatic uint64_t available_space(Server *s, bool verbose) {
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering uint64_t sum = 0, ss_avail = 0, avail = 0;
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering const char *f;
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering if (s->cached_available_space_timestamp + RECHECK_AVAILABLE_SPACE_USEC > ts
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering p = strappend(f, sd_id128_to_string(machine, ids));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
6f4dedb250f2d607eceefaa491f338becbeee7c0Tom Gundersen avail = ss_avail > m->keep_free ? ss_avail - m->keep_free : 0;
6f4dedb250f2d607eceefaa491f338becbeee7c0Tom Gundersen s->cached_available_space = MIN(m->max_use, avail) > sum ? MIN(m->max_use, avail) - sum : 0;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering s->cached_available_space_timestamp = ts;
6f4dedb250f2d607eceefaa491f338becbeee7c0Tom Gundersen char fb1[FORMAT_BYTES_MAX], fb2[FORMAT_BYTES_MAX], fb3[FORMAT_BYTES_MAX],
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering fb4[FORMAT_BYTES_MAX], fb5[FORMAT_BYTES_MAX];
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering server_driver_message(s, SD_MESSAGE_JOURNAL_USAGE,
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering "%s journal is using %s (max %s, leaving %s of free %s, current limit %s).",
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering s->system_journal ? "Permanent" : "Runtime",
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering format_bytes(fb2, sizeof(fb2), m->max_use),
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering format_bytes(fb3, sizeof(fb3), m->keep_free),
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering format_bytes(fb4, sizeof(fb4), ss_avail),
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering format_bytes(fb5, sizeof(fb5), MIN(m->max_use, avail)));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringvoid server_fix_perms(Server *s, JournalFile *f, uid_t uid) {
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering log_warning("Failed to fix access mode on %s, ignoring: %s", f->path, strerror(-r));
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering log_warning("Failed to read ACL on %s, ignoring: %m", f->path);
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering if (acl_create_entry(&acl, &entry) < 0 ||
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering log_warning("Failed to patch ACL on %s, ignoring: %m", f->path);
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering /* We do not recalculate the mask unconditionally here,
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering * so that the fchmod() mask above stays intact. */
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering if (acl_get_permset(entry, &permset) < 0 ||
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_warning("Failed to patch ACL on %s, ignoring: %m", f->path);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_warning("Failed to set ACL on %s, ignoring: %m", f->path);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringstatic JournalFile* find_journal(Server *s, uid_t uid) {
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering /* We split up user logs only on /var, not on /run. If the
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * runtime file is open, we write to it exclusively, in order
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering * to guarantee proper order as soon as we flush /run to
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * /var and close the runtime file. */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering f = hashmap_get(s->user_journals, UINT32_TO_PTR(uid));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (asprintf(&p, "/var/log/journal/" SD_ID128_FORMAT_STR "/user-%lu.journal",
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering SD_ID128_FORMAT_VAL(machine), (unsigned long) uid) < 0)
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering while (hashmap_size(s->user_journals) >= USER_JOURNALS_MAX) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* Too many open? Then let's close one */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering f = hashmap_steal_first(s->user_journals);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = journal_file_open_reliably(p, O_RDWR|O_CREAT, 0640, s->compress, s->seal, &s->system_metrics, s->mmap, NULL, &f);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = hashmap_put(s->user_journals, UINT32_TO_PTR(uid), f);
2c27fbca2d88214bd305272308a370a962818f1eLennart Poettering r = journal_file_rotate(&s->runtime_journal, s->compress, false);
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering log_error("Failed to rotate %s: %s", s->runtime_journal->path, strerror(-r));
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering log_error("Failed to create new runtime journal: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering server_fix_perms(s, s->runtime_journal, 0);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = journal_file_rotate(&s->system_journal, s->compress, s->seal);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to rotate %s: %s", s->system_journal->path, strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to create new system journal: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering server_fix_perms(s, s->system_journal, 0);
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = journal_file_rotate(&f, s->compress, s->seal);
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering log_error("Failed to rotate %s: %s", f->path, strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to create user journal: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering server_fix_perms(s, f, PTR_TO_UINT32(k));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = journal_file_set_offline(s->system_journal);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to sync system journal: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to sync user journal: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_OFF);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering log_error("Failed to disable sync timer source: %s", strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to get machine ID: %s", strerror(-r));
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering char *p = strappenda("/var/log/journal/", ids);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering r = journal_directory_vacuum(p, s->system_metrics.max_use, s->system_metrics.keep_free, s->max_retention_usec, &s->oldest_file_usec);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering if (r < 0 && r != -ENOENT)
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering log_error("Failed to vacuum %s: %s", p, strerror(-r));
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering char *p = strappenda("/run/log/journal/", ids);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering r = journal_directory_vacuum(p, s->runtime_metrics.max_use, s->runtime_metrics.keep_free, s->max_retention_usec, &s->oldest_file_usec);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering if (r < 0 && r != -ENOENT)
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_error("Failed to vacuum %s: %s", p, strerror(-r));
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poetteringstatic void server_cache_machine_id(Server *s) {
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering sd_id128_to_string(id, stpcpy(s->machine_id_field, "_MACHINE_ID="));
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poetteringstatic void server_cache_boot_id(Server *s) {
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering sd_id128_to_string(id, stpcpy(s->boot_id_field, "_BOOT_ID="));
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poetteringstatic void server_cache_hostname(Server *s) {
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poetteringbool shall_try_append_again(JournalFile *f, int r) {
19b50b5ba7ee8c1bfb330377309e4bab7a7531d8Lennart Poettering /* -E2BIG Hit configured limit
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering -EFBIG Hit fs limit
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering -EDQUOT Quota limit hit
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering -ENOSPC Disk full
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering -EHOSTDOWN Other machine
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering -EBUSY Unclean shutdown
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering -EPROTONOSUPPORT Unsupported feature
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering -EBADMSG Corrupted
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering -ENODATA Truncated
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering -ESHUTDOWN Already archived */
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering if (r == -E2BIG || r == -EFBIG || r == -EDQUOT || r == -ENOSPC)
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_debug("%s: Allocation limit reached, rotating.", f->path);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering else if (r == -EHOSTDOWN)
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_info("%s: Journal file from other machine, rotating.", f->path);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering else if (r == -EBUSY)
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_info("%s: Unclean shutdown, rotating.", f->path);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_info("%s: Unsupported feature, rotating.", f->path);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering else if (r == -EBADMSG || r == -ENODATA || r == ESHUTDOWN)
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering log_warning("%s: Journal file corrupted, rotating.", f->path);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poetteringstatic void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned n, int priority) {
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering if (journal_file_rotate_suggested(f, s->max_file_usec)) {
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering log_debug("%s: Journal header limits reached or header out-of-date, rotating.", f->path);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering if (vacuumed || !shall_try_append_again(f, r)) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering for (i = 0; i < n; i++)
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to write entry (%d items, %zu bytes), ignoring: %s", n, size, strerror(-r));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering for (i = 0; i < n; i++)
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering log_error("Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %s", n, size, strerror(-r));
static void dispatch_message_real(
Server *s,
const char *unit_id,
int priority,
bool owner_valid = false;
#ifdef HAVE_AUDIT
assert(s);
assert(n > 0);
if (ucred) {
free(t);
free(t);
free(t);
free(t);
#ifdef HAVE_AUDIT
r = cg_path_get_session(c, &t);
free(t);
owner_valid = true;
if (cg_path_get_unit(c, &t) >= 0) {
free(t);
if (cg_path_get_user_unit(c, &t) >= 0) {
free(t);
if (cg_path_get_slice(c, &t) >= 0) {
free(t);
free(c);
} else if (unit_id) {
#ifdef HAVE_SELINUX
if (use_selinux()) {
if (label) {
assert(n <= m);
if (object_pid) {
free(t);
free(t);
free(t);
#ifdef HAVE_AUDIT
r = cg_path_get_session(c, &t);
free(t);
if (cg_path_get_unit(c, &t) >= 0) {
free(t);
if (cg_path_get_user_unit(c, &t) >= 0) {
free(t);
free(c);
assert(n <= m);
if (tv) {
assert(n <= m);
journal_uid = 0;
assert(s);
void server_dispatch_message(
Server *s,
const char *unit_id,
int priority,
int rl, r;
assert(s);
if (!ucred)
goto finish;
goto finish;
if (rl == 0)
char *fn;
if (!s->system_journal &&
r = journal_file_open_reliably(fn, O_RDWR|O_CREAT, 0640, s->compress, s->seal, &s->system_metrics, s->mmap, NULL, &s->system_journal);
if (!s->runtime_journal &&
if (!fn)
return -ENOMEM;
if (s->system_journal) {
r = journal_file_open(fn, O_RDWR, 0640, s->compress, false, &s->runtime_metrics, s->mmap, NULL, &s->runtime_journal);
if (r != -ENOENT)
r = journal_file_open_reliably(fn, O_RDWR|O_CREAT, 0640, s->compress, false, &s->runtime_metrics, s->mmap, NULL, &s->runtime_journal);
if (s->runtime_journal)
available_space(s, true);
assert(s);
if (!s->runtime_journal)
if (!s->system_journal)
SD_JOURNAL_FOREACH(j) {
JournalFile *f;
f = j->current_file;
goto finish;
goto finish;
server_rotate(s);
server_vacuum(s);
if (!s->system_journal) {
r = -EIO;
goto finish;
goto finish;
sd_journal_close(j);
server_driver_message(s, SD_ID128_NULL, "Time spent on flushing to /var is %s for %u entries.", format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0), n);
assert(s);
return -EIO;
} control = {};
ssize_t n;
unsigned n_fds = 0;
return -errno;
return log_oom();
return -errno;
if (n > 0 && n_fds == 0) {
s->buffer[n] = 0;
} else if (n_fds > 0)
if (n > 0 && n_fds == 0)
else if (n_fds > 0)
static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) {
assert(s);
server_sync(s);
static int dispatch_sigusr2(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) {
assert(s);
server_rotate(s);
server_vacuum(s);
static int dispatch_sigterm(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) {
assert(s);
assert(s);
char *w, *state;
size_t l;
if (!word)
return -ENOMEM;
s->forward_to_syslog = r;
s->forward_to_kmsg = r;
s->forward_to_console = r;
assert(s);
return -errno;
(void*) journald_gperf_lookup, false, false, s);
assert(s);
server_sync(s);
assert(s);
server_sync(s);
if (s->sync_scheduled)
if (s->sync_interval_usec > 0) {
if (!s->sync_event_source) {
s->sync_scheduled = true;
static int dispatch_hostname_change(sd_event_source *es, int fd, uint32_t revents, void *userdata) {
assert(s);
assert(s);
if (s->hostname_fd < 0) {
return -errno;
r = sd_event_add_io(s->event, s->hostname_fd, 0, dispatch_hostname_change, s, &s->hostname_event_source);
int n, r, fd;
assert(s);
zero(*s);
s->compress = true;
s->seal = true;
s->sync_scheduled = false;
s->forward_to_syslog = true;
(long long unsigned) s->rate_limit_interval,
s->rate_limit_burst);
if (!s->user_journals)
return log_oom();
if (!s->mmap)
return log_oom();
n = sd_listen_fds(true);
if (s->native_fd >= 0) {
return -EINVAL;
if (s->stdout_fd >= 0) {
return -EINVAL;
if (s->syslog_fd >= 0) {
return -EINVAL;
return -EINVAL;
r = server_open_syslog_socket(s);
r = server_open_native_socket(s);
r = server_open_stdout_socket(s);
r = server_open_dev_kmsg(s);
r = server_open_kernel_seqnum(s);
r = server_open_hostname(s);
r = setup_signals(s);
if (!s->udev)
return -ENOMEM;
if (!s->rate_limit)
return -ENOMEM;
r = system_journal_open(s);
#ifdef HAVE_GCRYPT
JournalFile *f;
Iterator i;
usec_t n;
if (s->system_journal)
JournalFile *f;
assert(s);
while (s->stdout_streams)
if (s->system_journal)
if (s->runtime_journal)
if (s->syslog_fd >= 0)
if (s->native_fd >= 0)
if (s->stdout_fd >= 0)
if (s->dev_kmsg_fd >= 0)
if (s->hostname_fd >= 0)
if (s->rate_limit)
if (s->kernel_seqnum)
if (s->mmap)
if (s->udev)