| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "journal-file.h" |
| 5 |
#include "journald-forward.h" |
| 6 |
#include "socket-util.h" |
| 7 |
|
| 8 |
typedef enum Storage { |
| 9 |
STORAGE_AUTO, |
| 10 |
STORAGE_VOLATILE, |
| 11 |
STORAGE_PERSISTENT, |
| 12 |
STORAGE_NONE, |
| 13 |
_STORAGE_MAX, |
| 14 |
_STORAGE_INVALID = -EINVAL, |
| 15 |
} Storage; |
| 16 |
|
| 17 |
typedef enum SplitMode { |
| 18 |
SPLIT_UID, |
| 19 |
SPLIT_LOGIN, /* deprecated */ |
| 20 |
SPLIT_NONE, |
| 21 |
_SPLIT_MAX, |
| 22 |
_SPLIT_INVALID = -EINVAL, |
| 23 |
} SplitMode; |
| 24 |
|
| 25 |
typedef struct JournalCompressOptions { |
| 26 |
int enabled; |
| 27 |
uint64_t threshold_bytes; |
| 28 |
} JournalCompressOptions; |
| 29 |
|
| 30 |
typedef enum AuditSetMode { |
| 31 |
AUDIT_NO = 0, /* Disables the kernel audit subsystem on start. */ |
| 32 |
AUDIT_YES, /* Enables the kernel audit subsystem on start. */ |
| 33 |
AUDIT_KEEP, /* Keep the current kernel audit subsystem state. */ |
| 34 |
_AUDIT_SET_MODE_MAX, |
| 35 |
_AUDIT_SET_MODE_INVALID = -EINVAL, |
| 36 |
} AuditSetMode; |
| 37 |
|
| 38 |
typedef struct JournalConfig { |
| 39 |
/* Storage=, cred: journal.storage */ |
| 40 |
Storage storage; |
| 41 |
/* Compress= */ |
| 42 |
JournalCompressOptions compress; |
| 43 |
/* Seal= */ |
| 44 |
int seal; |
| 45 |
/* ReadKMsg= */ |
| 46 |
int read_kmsg; |
| 47 |
/* Audit= */ |
| 48 |
AuditSetMode set_audit; |
| 49 |
/* SyncIntervalSec= */ |
| 50 |
usec_t sync_interval_usec; |
| 51 |
/* RateLimitIntervalSec= */ |
| 52 |
usec_t ratelimit_interval; |
| 53 |
/* RateLimitBurst= */ |
| 54 |
unsigned ratelimit_burst; |
| 55 |
/* SystemMaxUse=, SystemMaxFileSize=, SystemKeepFree=, SystemMaxFiles= */ |
| 56 |
JournalMetrics system_storage_metrics; |
| 57 |
/* RuntimeMaxUse=, RuntimeMaxFileSize=, RuntimeKeepFree=, RuntimeMaxFiles= */ |
| 58 |
JournalMetrics runtime_storage_metrics; |
| 59 |
/* MaxRetentionSec= */ |
| 60 |
usec_t max_retention_usec; |
| 61 |
/* MaxFileSec= */ |
| 62 |
usec_t max_file_usec; |
| 63 |
/* ForwardToSyslog=, proc: systemd.journald.forward_to_syslog */ |
| 64 |
int forward_to_syslog; |
| 65 |
/* ForwardToKMsg=, proc: systemd.journald.forward_to_kmsg */ |
| 66 |
int forward_to_kmsg; |
| 67 |
/* ForwardToConsole=, proc: systemd.journald.forward_to_console */ |
| 68 |
int forward_to_console; |
| 69 |
/* ForwardToWall=, proc: systemd.journald.forward_to_wall */ |
| 70 |
int forward_to_wall; |
| 71 |
/* ForwardToSocket=, cred: journal.forward_to_socket */ |
| 72 |
SocketAddress forward_to_socket; |
| 73 |
/* TTYPath= */ |
| 74 |
char *tty_path; |
| 75 |
/* MaxLevelStore=, proc: systemd.journald.max_level_store */ |
| 76 |
int max_level_store; |
| 77 |
/* MaxLevelSyslog=, proc: systemd.journald.max_level_syslog */ |
| 78 |
int max_level_syslog; |
| 79 |
/* MaxLevelKMsg=, proc: systemd.journald.max_level_kmsg */ |
| 80 |
int max_level_kmsg; |
| 81 |
/* MaxLevelConsole=, proc: systemd.journald.max_level_console */ |
| 82 |
int max_level_console; |
| 83 |
/* MaxLevelWall=, systemd.journald.max_level_wall */ |
| 84 |
int max_level_wall; |
| 85 |
/* MaxLevelSocket=, systemd.journald.max_level_socket */ |
| 86 |
int max_level_socket; |
| 87 |
/* SplitMode= */ |
| 88 |
SplitMode split_mode; |
| 89 |
/* LineMax= */ |
| 90 |
size_t line_max; |
| 91 |
} JournalConfig; |
| 92 |
|
| 93 |
void journal_config_done(JournalConfig *c); |
| 94 |
void journal_config_set_defaults(JournalConfig *c); |
| 95 |
void manager_merge_configs(Manager *m); |
| 96 |
void manager_load_config(Manager *m); |
| 97 |
int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata); |
| 98 |
|
| 99 |
/* Defined in generated journald-gperf.c */ |
| 100 |
const struct ConfigPerfItem* journald_gperf_lookup(const char *str, GPERF_LEN_TYPE length); |
| 101 |
|
| 102 |
DECLARE_STRING_TABLE_LOOKUP(storage, Storage); |
| 103 |
|
| 104 |
DECLARE_STRING_TABLE_LOOKUP(split_mode, SplitMode); |
| 105 |
|
| 106 |
CONFIG_PARSER_PROTOTYPE(config_parse_storage); |
| 107 |
CONFIG_PARSER_PROTOTYPE(config_parse_line_max); |
| 108 |
CONFIG_PARSER_PROTOTYPE(config_parse_compress); |
| 109 |
CONFIG_PARSER_PROTOTYPE(config_parse_forward_to_socket); |
| 110 |
CONFIG_PARSER_PROTOTYPE(config_parse_split_mode); |
| 111 |
CONFIG_PARSER_PROTOTYPE(config_parse_audit_set_mode); |