1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lvmdbusd: Only disable notify_dbus after getting external event

If we always disable the sending of notify dbus events then in the case
where all the users are lvm dbus users we will be in udev handling mode
until at least 1 external lvm command occurs.  Instead we will not disable
notify dbus until after we get at least 1 external event.  This makes the
service get into the correct mode of operation faster.
This commit is contained in:
Tony Asleson 2017-03-15 10:57:01 -05:00
parent 17b56a4aed
commit 2dc71fc291

View File

@ -510,16 +510,19 @@ def add_no_notify(cmdline):
:rtype: list
"""
if 'help' in cmdline:
return cmdline
# Only after we have seen an external event will be disable lvm from sending
# us one when we call lvm
if cfg.ee:
if 'help' in cmdline:
return cmdline
if '--config' in cmdline:
for i, arg in enumerate(cmdline):
if arg == '--config':
cmdline[i] += "global/notify_dbus=0"
break
else:
cmdline.extend(['--config', 'global/notify_dbus=0'])
if '--config' in cmdline:
for i, arg in enumerate(cmdline):
if arg == '--config':
cmdline[i] += "global/notify_dbus=0"
break
else:
cmdline.extend(['--config', 'global/notify_dbus=0'])
return cmdline