mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
meson: create /var/log/journal/{,remote/} conditionally
Not everybody has those dirs in the filesystem (and they don't need to). When creating an installation package using $DESTDIR, it is easy enough to remove or ignore those directories, but if installing into a real root, it is ugly to create and remove them. Let's add an option so people can skip it if they want. Inspired by #12930.
This commit is contained in:
parent
7810d22171
commit
6ed5ef9819
@ -5,7 +5,7 @@ file = configure_file(
|
||||
output : 'README',
|
||||
configuration : substs)
|
||||
|
||||
if conf.get('HAVE_SYSV_COMPAT') == 1
|
||||
if conf.get('HAVE_SYSV_COMPAT') == 1 and get_option('create-log-dirs')
|
||||
install_data(file,
|
||||
install_dir : varlogdir)
|
||||
endif
|
||||
|
@ -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'],
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user