1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdbusd: Move cfg.lvmdebug data init

Move this to the cfg file itself, so that initialization runs when it
gets processed.
This commit is contained in:
Tony Asleson 2023-03-06 10:25:22 -06:00
parent 8e27dfd405
commit df6120e9f7
2 changed files with 5 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import os
import multiprocessing
import queue
import itertools
from utils import LvmDebugData
from lvmdbusd import path
@ -18,6 +19,10 @@ LVM_CMD = os.getenv('LVM_BINARY', path.LVM_BINARY)
LOCK_FILE = os.getenv("LVM_DBUSD_LOCKFILE", "/var/lock/lvm/lvmdbusd")
# Save off the debug data needed for lvm team to debug issues
# only used for 'fullreport' at this time.
lvmdebug = LvmDebugData(os.getenv('LVM_DBUSD_COLLECT_LVM_DEBUG', False))
# This is the global object manager
om = None
@ -114,7 +119,4 @@ def exit_daemon():
loop.quit()
# Debug data for lvm
lvmdebug = None
systemd = False

View File

@ -148,17 +148,12 @@ def running_under_systemd():
def main():
start = time.time()
use_session = os.getenv('LVM_DBUSD_USE_SESSION', False)
collect_lvm_debug = os.getenv('LVM_DBUSD_COLLECT_LVM_DEBUG', False)
# Ensure that we get consistent output for parsing stdout/stderr and that we
# are using the lvmdbusd profile.
os.environ["LC_ALL"] = "C"
os.environ["LVM_COMMAND_PROFILE"] = "lvmdbusd"
# Save off the debug data needed for lvm team to debug issues
# only used for 'fullreport' at this time.
cfg.lvmdebug = utils.LvmDebugData(collect_lvm_debug)
# Indicator if we are running under systemd
cfg.systemd = running_under_systemd()