From 938d3f419ee2d41d65e8ba0bc39d5a5ec1a512b2 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 27 Mar 2024 11:48:05 -0400 Subject: [PATCH] properly detect if running via systemd --- installation/relay.service | 1 + relay/logger.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/installation/relay.service b/installation/relay.service index 0325316..cf9fa6a 100644 --- a/installation/relay.service +++ b/installation/relay.service @@ -4,6 +4,7 @@ Description=ActivityPub Relay [Service] WorkingDirectory=/home/relay/relay ExecStart=/usr/bin/python3 -m relay run +Environment="IS_SYSTEMD=1" [Install] WantedBy=multi-user.target diff --git a/relay/logger.py b/relay/logger.py index b8ff918..9729eb2 100644 --- a/relay/logger.py +++ b/relay/logger.py @@ -87,7 +87,7 @@ handlers: list[Any] = [logging.StreamHandler()] if env_log_file: handlers.append(logging.FileHandler(env_log_file)) -if os.environ.get('INVOCATION_ID'): +if os.environ.get('IS_SYSTEMD'): logging_format = '%(levelname)s: %(message)s' else: