From d40c908f9eb768c3f93ae7dc60ee7eb4c358ed4f Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 12 Jun 2024 16:00:48 +0200 Subject: common.py: Add a check for $JOURNAL_STREAM. On the desktop's terminal window (systemd 256) $SYSTEMD_EXEC_PID exists and points at the login(1) process, so checking $JOURNAL_STREAM is needed to decide whether the process runs from a .service file or not. This is due to an incomplete logic in 42cfe748e23bad6fc51b14a3e5896a77fdb5c1d5 --- common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common.py') diff --git a/common.py b/common.py index 88a0f4d..e1c13ab 100644 --- a/common.py +++ b/common.py @@ -32,7 +32,7 @@ def init_logger(app=__file__, level=logging.WARNING): log = logging.getLogger() log.setLevel(level) - if os.getenv('SYSTEMD_EXEC_PID', None) is None: + if os.getenv('SYSTEMD_EXEC_PID', None) is None or os.getenv('JOURNAL_STREAM', None) is None: ch = logging.StreamHandler() else: # started in systemd, use journald for filtering incl. coloring -- cgit v1.2.3