diff --git a/man/custom-entities.ent.in b/man/custom-entities.ent.in index 6338ad13f96..1f3ecefe614 100644 --- a/man/custom-entities.ent.in +++ b/man/custom-entities.ent.in @@ -10,6 +10,7 @@ + diff --git a/man/journald.conf.xml b/man/journald.conf.xml index 1d615b110dc..322fe6d17b6 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -1,6 +1,9 @@ + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + +%entities; +]> /var/log/journal directory exists, and volatile otherwise (the existence of the directory controls the storage mode). none turns off all storage, all log data received will be dropped (but forwarding to other targets, such as the console, - the kernel log buffer, or a syslog socket will still work). Defaults to auto in - the default journal namespace, and persistent in all others. + the kernel log buffer, or a syslog socket will still work). Defaults to + &JOURNAL_STORAGE_DEFAULT; in the default journal namespace (this value is + determined at compilation time), and persistent in all others. Note that journald will initially use volatile storage, until a call to journalctl --flush (or sending SIGUSR1 to journald) will cause diff --git a/meson.build b/meson.build index 599d2a3217d..055ee31ee4c 100644 --- a/meson.build +++ b/meson.build @@ -117,6 +117,9 @@ conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max')) conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open')) conf.set('HIGH_RLIMIT_NOFILE', 512*1024) +conf.set('JOURNAL_STORAGE_DEFAULT', get_option('journal-storage-default')) +conf.set('JOURNAL_STORAGE_DEFAULT_VAL', 'STORAGE_' + get_option('journal-storage-default').to_upper()) + # Meson ignores the preceding arguments when joining paths if an absolute # component is encountered, so this should canonicalize various paths when they # are absolute or relative. @@ -3096,6 +3099,7 @@ summary({ 'default locale' : default_locale, 'default nspawn locale' : nspawn_locale, 'default status unit format' : status_unit_format_default, + 'default journal storage mode' : conf.get('JOURNAL_STORAGE_DEFAULT'), 'default user $PATH' : default_user_path != '' ? default_user_path : '(same as system services)', 'systemd service watchdog' : service_watchdog == '' ? 'disabled' : service_watchdog, 'time epoch' : f'@time_epoch@ (@alt_time_epoch@)', diff --git a/meson_options.txt b/meson_options.txt index 1d7c4f4bd27..f8a0fe37123 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -139,6 +139,8 @@ option('timedated', type : 'boolean', description : 'install the systemd-timedated daemon') option('timesyncd', type : 'boolean', description : 'install the systemd-timesyncd daemon') +option('journal-storage-default', type : 'combo', choices : ['auto', 'volatile', 'persistent', 'none'], + description : 'default storage mode for journald (main namespace)') option('remote', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' }, description : 'support for "journal over the network"') option('create-log-dirs', type : 'boolean', diff --git a/src/journal/journald-config.c b/src/journal/journald-config.c index 8cffec880b2..de78a40008f 100644 --- a/src/journal/journald-config.c +++ b/src/journal/journald-config.c @@ -116,7 +116,7 @@ void manager_merge_configs(Manager *m) { journal_config_done(&m->config); - MERGE_NON_NEGATIVE(storage, STORAGE_AUTO); + MERGE_NON_NEGATIVE(storage, JOURNAL_STORAGE_DEFAULT_VAL); manager_merge_journal_compress_options(m); MERGE_NON_NEGATIVE(seal, true); /* By default, /dev/kmsg is read only by the main namespace instance. */ diff --git a/src/journal/journald.conf.in b/src/journal/journald.conf.in index 9a12ca76576..805b79bc8ad 100644 --- a/src/journal/journald.conf.in +++ b/src/journal/journald.conf.in @@ -17,7 +17,7 @@ # See journald.conf(5) for details. [Journal] -#Storage=auto +#Storage={{ JOURNAL_STORAGE_DEFAULT }} #Compress=yes #Seal=yes #SplitMode=uid