From 4b6ea35bfcc75fabae5904255fba1102c750027b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 7 Oct 2019 14:36:30 +0200 Subject: [PATCH] debian: disable syslog loggers if there's no /dev/log (#36738) --- debian/debian_config_common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/debian_config_common.py b/debian/debian_config_common.py index 92f5cba..3ce7e17 100644 --- a/debian/debian_config_common.py +++ b/debian/debian_config_common.py @@ -167,6 +167,13 @@ if os.path.exists('/run/systemd/journal/socket'): LOGGING['loggers']['']['handlers'].remove('syslog') LOGGING['loggers']['']['handlers'].append('journald') +elif not os.path.exists('/dev/log'): + # if three's no syslog (for example when building a docker image), remove + # those loggers. + LOGGING['loggers']['']['handlers'].remove('syslog') + LOGGING['loggers']['py.warnings']['handlers'].remove('syslog_no_filter') + + ETC_DIR = '/etc/%s' % PROJECT_NAME VAR_DIR = '/var/lib/%s' % PROJECT_NAME