mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38:00 +00:00
properly detect if running via systemd
This commit is contained in:
parent
6112734b2f
commit
938d3f419e
|
@ -4,6 +4,7 @@ Description=ActivityPub Relay
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/relay/relay
|
WorkingDirectory=/home/relay/relay
|
||||||
ExecStart=/usr/bin/python3 -m relay run
|
ExecStart=/usr/bin/python3 -m relay run
|
||||||
|
Environment="IS_SYSTEMD=1"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -87,7 +87,7 @@ handlers: list[Any] = [logging.StreamHandler()]
|
||||||
if env_log_file:
|
if env_log_file:
|
||||||
handlers.append(logging.FileHandler(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'
|
logging_format = '%(levelname)s: %(message)s'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue