aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-06-12 16:00:48 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-06-12 16:04:52 +0200
commitd40c908f9eb768c3f93ae7dc60ee7eb4c358ed4f (patch)
tree96dadc28c08cc8f39f9d1cd2073f7ce680de0e01
parent3bd492be08a97c16c813bc57773028def5c69e23 (diff)
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
-rw-r--r--common.py2
1 files changed, 1 insertions, 1 deletions
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