1
0
mirror of https://github.com/systemd/systemd synced 2026-04-11 17:44:58 +02:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Luca Boccassi
d39d3696c0
Merge pull request #21898 from yuwata/meson-dbus-interfaces-dir
meson: obtain dbus related directories from pkg-config
2021-12-29 12:39:50 +00:00
Yu Watanabe
9c1b17c3dc manager: always close idle pipe when sending ready notification
This fixes a bug introduced by 6d9326595592f98e8126eacb4176acd8c3516d5c.

The commit makes several functions skipped if the manager is already
in finished state, as
> In manager_check_finished(), more steps are skipped if MANAGER_IS_FINISHED().
> Those steps are idempotent, but no need to waste cycles trying to do them
> more than once.

However, the idle pipe may be re-opened after manager is finished:
manager_dispatch_run_queue() -> manager_watch_idle_pipe().
So, the closing the pipe is not idempotent here.

Fixes #21889.
2021-12-29 12:35:48 +00:00
Yu Watanabe
1bd0cc452c meson: obtain dbus directories from pkg-config 2021-12-28 23:00:58 +09:00
Yu Watanabe
7e560e79eb meson: show dbus interfaces directory in summary 2021-12-28 22:52:24 +09:00
Yu Watanabe
320848a6ba meson: move dbus-interfaces-dir 2021-12-28 22:52:24 +09:00
3 changed files with 61 additions and 34 deletions

View File

@ -191,21 +191,6 @@ if docdir == ''
docdir = datadir / 'doc/systemd' docdir = datadir / 'doc/systemd'
endif endif
dbuspolicydir = get_option('dbuspolicydir')
if dbuspolicydir == ''
dbuspolicydir = datadir / 'dbus-1/system.d'
endif
dbussessionservicedir = get_option('dbussessionservicedir')
if dbussessionservicedir == ''
dbussessionservicedir = datadir / 'dbus-1/services'
endif
dbussystemservicedir = get_option('dbussystemservicedir')
if dbussystemservicedir == ''
dbussystemservicedir = datadir / 'dbus-1/system-services'
endif
pamlibdir = get_option('pamlibdir') pamlibdir = get_option('pamlibdir')
if pamlibdir == '' if pamlibdir == ''
pamlibdir = rootlibdir / 'security' pamlibdir = rootlibdir / 'security'
@ -1473,6 +1458,59 @@ else
endif endif
conf.set10('HAVE_DBUS', have) conf.set10('HAVE_DBUS', have)
dbusdatadir = datadir / 'dbus-1'
if conf.get('HAVE_DBUS') == 1
dbusdatadir = libdbus.get_variable(pkgconfig: 'datadir', default_value: datadir) / 'dbus-1'
endif
dbuspolicydir = get_option('dbuspolicydir')
if dbuspolicydir == ''
dbuspolicydir = dbusdatadir / 'system.d'
endif
dbussessionservicedir = get_option('dbussessionservicedir')
if dbussessionservicedir == ''
dbussessionservicedir = dbusdatadir / 'services'
if conf.get('HAVE_DBUS') == 1
dbussessionservicedir = libdbus.get_variable(pkgconfig: 'session_bus_services_dir', default_value: dbussessionservicedir)
endif
endif
dbussystemservicedir = get_option('dbussystemservicedir')
if dbussystemservicedir == ''
dbussystemservicedir = dbusdatadir / 'system-services'
if conf.get('HAVE_DBUS') == 1
dbussystemservicedir = libdbus.get_variable(pkgconfig: 'system_bus_services_dir', default_value: dbussystemservicedir)
endif
endif
dbus_interfaces_dir = get_option('dbus-interfaces-dir')
if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes'
if meson.is_cross_build() and dbus_interfaces_dir != 'yes'
dbus_interfaces_dir = 'no'
warning('Exporting D-Bus interface XML files is disabled during cross build. Pass path or "yes" to force enable.')
else
dbus_interfaces_dir = dbusdatadir / 'interfaces'
if conf.get('HAVE_DBUS') == 1
dbus_interfaces_dir = libdbus.get_variable(pkgconfig: 'interfaces_dir', default_value: dbus_interfaces_dir)
endif
endif
endif
if dbus_interfaces_dir == dbusdatadir / 'interfaces' or dbus_interfaces_dir == 'no'
dbus_interfaces_dir_name = 'interfaces'
dbus_interfaces_dir_parent = dbusdatadir
else
elements = dbus_interfaces_dir.split('/')
dbus_interfaces_dir_name = elements[-1]
dbus_interfaces_dir_parent = '/'
foreach elem : elements
if elem == dbus_interfaces_dir_name and dbus_interfaces_dir == dbus_interfaces_dir_parent / dbus_interfaces_dir_name
break
endif
dbus_interfaces_dir_parent = dbus_interfaces_dir_parent / elem
endforeach
endif
# We support one or the other. If gcrypt is available, we assume it's there to # We support one or the other. If gcrypt is available, we assume it's there to
# be used, and use it in preference. # be used, and use it in preference.
opt = get_option('cryptolib') opt = get_option('cryptolib')
@ -1731,17 +1769,6 @@ public_programs = []
# D-Bus introspection XML export # D-Bus introspection XML export
dbus_programs = [] dbus_programs = []
dbus_interfaces_dir = get_option('dbus-interfaces-dir')
if dbus_interfaces_dir == ''
if not meson.is_cross_build()
dbus_interfaces_dir = datadir / 'dbus-1'
else
message('D-Bus interfaces export is disabled during cross build. Pass path or yes to force enable.')
dbus_interfaces_dir = 'no'
endif
elif dbus_interfaces_dir == 'yes'
dbus_interfaces_dir = datadir / 'dbus-1'
endif
basic_includes = include_directories( basic_includes = include_directories(
'src/basic', 'src/basic',
@ -3876,9 +3903,9 @@ alias_target('update-man-rules', update_man_rules)
custom_target( custom_target(
'export-dbus-interfaces', 'export-dbus-interfaces',
output : 'interfaces', output : dbus_interfaces_dir_name,
install : dbus_interfaces_dir != 'no', install : dbus_interfaces_dir != 'no',
install_dir : dbus_interfaces_dir, install_dir : dbus_interfaces_dir_parent,
command : [export_dbus_interfaces_py, '@OUTPUT@', dbus_programs]) command : [export_dbus_interfaces_py, '@OUTPUT@', dbus_programs])
############################################################ ############################################################
@ -3905,6 +3932,7 @@ summary({
'D-Bus policy directory' : dbuspolicydir, 'D-Bus policy directory' : dbuspolicydir,
'D-Bus session directory' : dbussessionservicedir, 'D-Bus session directory' : dbussessionservicedir,
'D-Bus system directory' : dbussystemservicedir, 'D-Bus system directory' : dbussystemservicedir,
'D-Bus interfaces directory' : dbus_interfaces_dir,
'bash completions directory' : bashcompletiondir, 'bash completions directory' : bashcompletiondir,
'zsh completions directory' : zshcompletiondir, 'zsh completions directory' : zshcompletiondir,
'private shared lib version tag' : shared_lib_tag, 'private shared lib version tag' : shared_lib_tag,

View File

@ -179,6 +179,8 @@ option('dbussessionservicedir', type : 'string',
description : 'D-Bus session service directory') description : 'D-Bus session service directory')
option('dbussystemservicedir', type : 'string', option('dbussystemservicedir', type : 'string',
description : 'D-Bus system service directory') description : 'D-Bus system service directory')
option('dbus-interfaces-dir', type : 'string',
description : 'export D-Bus introspection XML as standalone files')
option('pkgconfigdatadir', type : 'string', value : '', option('pkgconfigdatadir', type : 'string', value : '',
description : 'directory for arch-independent pkg-config files') description : 'directory for arch-independent pkg-config files')
option('pkgconfiglibdir', type : 'string', value : '', option('pkgconfiglibdir', type : 'string', value : '',
@ -484,6 +486,3 @@ option('analyze', type: 'boolean', value: 'true',
option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'], option('bpf-framework', type : 'combo', choices : ['auto', 'true', 'false'],
description: 'build BPF programs from source code in restricted C') description: 'build BPF programs from source code in restricted C')
option('dbus-interfaces-dir', type : 'string',
description : 'export D-Bus introspection XML as standalone files')

View File

@ -3557,14 +3557,14 @@ void manager_check_finished(Manager *m) {
manager_send_ready(m); manager_send_ready(m);
/* Notify Type=idle units that we are done now */
manager_close_idle_pipe(m);
if (MANAGER_IS_FINISHED(m)) if (MANAGER_IS_FINISHED(m))
return; return;
manager_flip_auto_status(m, false, "boot finished"); manager_flip_auto_status(m, false, "boot finished");
/* Notify Type=idle units that we are done now */
manager_close_idle_pipe(m);
/* Turn off confirm spawn now */ /* Turn off confirm spawn now */
m->confirm_spawn = NULL; m->confirm_spawn = NULL;