diff --git a/docs/var-log/README b/docs/var-log/README new file mode 100644 index 0000000000..5c6c5924b5 --- /dev/null +++ b/docs/var-log/README @@ -0,0 +1,25 @@ +You are looking for the traditional text log files in /var/log, and they are +gone? + +Here's an explanation on what's going on: + +You are running a systemd-based OS where traditional syslog has been replaced +with the Journal. The journal stores the same (and more) information as classic +syslog. To make use of the journal and access the collected log data simply +invoke "journalctl", which will output the logs in the identical text-based +format the syslog files in /var/log used to be. For further details, please +refer to journalctl(1). + +Alternatively, consider installing one of the traditional syslog +implementations available for your distribution, which will generate the +classic log files for you. Syslog implementations such as syslog-ng or rsyslog +may be installed side-by-side with the journal and will continue to function +the way they always did. + +Thank you! + +Further reading: + man:journalctl(1) + man:systemd-journald.service(8) + man:journald.conf(5) + http://0pointer.de/blog/projects/the-journal.html diff --git a/docs/var-log/README.in b/docs/var-log/README.in deleted file mode 100644 index 2e64fb196a..0000000000 --- a/docs/var-log/README.in +++ /dev/null @@ -1,26 +0,0 @@ -You are looking for the traditional text log files in @VARLOGDIR@, and -they are gone? - -Here's an explanation on what's going on: - -You are running a systemd-based OS where traditional syslog has been -replaced with the Journal. The journal stores the same (and more) -information as classic syslog. To make use of the journal and access -the collected log data simply invoke "journalctl", which will output -the logs in the identical text-based format the syslog files in -@VARLOGDIR@ used to be. For further details, please refer to -journalctl(1). - -Alternatively, consider installing one of the traditional syslog -implementations available for your distribution, which will generate -the classic log files for you. Syslog implementations such as -syslog-ng or rsyslog may be installed side-by-side with the journal -and will continue to function the way they always did. - -Thank you! - -Further reading: - man:journalctl(1) - man:systemd-journald.service(8) - man:journald.conf(5) - http://0pointer.de/blog/projects/the-journal.html diff --git a/docs/var-log/meson.build b/docs/var-log/meson.build index 0ddff20ce5..81b7865438 100644 --- a/docs/var-log/meson.build +++ b/docs/var-log/meson.build @@ -1,11 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1+ -file = configure_file( - input : 'README.in', - output : 'README', - configuration : substs) - -if conf.get('HAVE_SYSV_COMPAT') == 1 - install_data(file, - install_dir : varlogdir) +if conf.get('HAVE_SYSV_COMPAT') == 1 and get_option('create-log-dirs') + install_data('README', + install_dir : '/var/log') endif diff --git a/meson.build b/meson.build index 3988fb76bd..3a936947bb 100644 --- a/meson.build +++ b/meson.build @@ -113,7 +113,6 @@ pkgconfiglibdir = get_option('pkgconfiglibdir') == '' ? join_paths(libdir, 'pkgc polkitpolicydir = join_paths(datadir, 'polkit-1/actions') polkitrulesdir = join_paths(datadir, 'polkit-1/rules.d') polkitpkladir = join_paths(localstatedir, 'lib/polkit-1/localauthority/10-vendor.d') -varlogdir = join_paths(localstatedir, 'log') xinitrcdir = join_paths(sysconfdir, 'X11/xinit/xinitrc.d') rpmmacrosdir = get_option('rpmmacrosdir') if rpmmacrosdir != 'no' @@ -272,7 +271,6 @@ substs.set('systemenvgeneratordir', systemenvgenerator substs.set('userenvgeneratordir', userenvgeneratordir) substs.set('systemshutdowndir', systemshutdowndir) substs.set('systemsleepdir', systemsleepdir) -substs.set('VARLOGDIR', varlogdir) substs.set('CERTIFICATEROOT', get_option('certificate-root')) substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl')) substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) diff --git a/meson_options.txt b/meson_options.txt index e56d33760b..7c8a769bbc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -95,6 +95,8 @@ option('timesyncd', type : 'boolean', description : 'install the systemd-timesyncd daemon') option('remote', type : 'combo', choices : ['auto', 'true', 'false'], description : 'support for "journal over the network"') +option('create-log-dirs', type : 'boolean', + description : 'create /var/log/journal{,/remote}') option('nss-myhostname', type : 'boolean', description : 'install nss-myhostname module') option('nss-mymachines', type : 'combo', choices : ['auto', 'true', 'false'], diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index 2887daa4bf..87b8ba6495 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -63,9 +63,11 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 install_data('browse.html', install_dir : join_paths(pkgdatadir, 'gatewayd')) - meson.add_install_script('sh', '-c', - mkdir_p.format('/var/log/journal/remote')) - meson.add_install_script('sh', '-c', - '''chown 0:0 $DESTDIR/var/log/journal/remote && - chmod 755 $DESTDIR/var/log/journal/remote || :''') + if get_option('create-log-dirs') + meson.add_install_script('sh', '-c', + mkdir_p.format('/var/log/journal/remote')) + meson.add_install_script('sh', '-c', + '''chown 0:0 $DESTDIR/var/log/journal/remote && + chmod 755 $DESTDIR/var/log/journal/remote || :''') + endif endif diff --git a/src/journal/meson.build b/src/journal/meson.build index e03d6dc232..5796f77cac 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -111,20 +111,22 @@ endif install_data('journald.conf', install_dir : pkgsysconfdir) -meson.add_install_script( - 'sh', '-c', - mkdir_p.format('/var/log/journal')) -meson.add_install_script( - 'sh', '-c', - '''chown 0:0 $DESTDIR/var/log/journal && - chmod 755 $DESTDIR/var/log/journal || :''') -if get_option('adm-group') +if get_option('create-log-dirs') meson.add_install_script( 'sh', '-c', - 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') -endif -if get_option('wheel-group') + mkdir_p.format('/var/log/journal')) meson.add_install_script( 'sh', '-c', - 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') + '''chown 0:0 $DESTDIR/var/log/journal && + chmod 755 $DESTDIR/var/log/journal || :''') + if get_option('adm-group') + meson.add_install_script( + 'sh', '-c', + 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :') + endif + if get_option('wheel-group') + meson.add_install_script( + 'sh', '-c', + 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :') + endif endif