diff --git a/data/lib/systemd/system/plinth.service b/data/lib/systemd/system/plinth.service index dc17ab6b0..267d994ca 100644 --- a/data/lib/systemd/system/plinth.service +++ b/data/lib/systemd/system/plinth.service @@ -16,7 +16,7 @@ # [Unit] -Description=Plinth Web Interface +Description=FreedomBox Service (Plinth) Documentation=man:plinth(1) After=network.target @@ -26,6 +26,8 @@ Restart=on-failure ExecReload=/bin/kill -HUP $MAINPID User=plinth Group=plinth +StandardOutput=null +StandardError=null [Install] WantedBy=multi-user.target diff --git a/debian/control b/debian/control index 3e7bb9c85..1cde81985 100644 --- a/debian/control +++ b/debian/control @@ -38,6 +38,7 @@ Build-Depends: debhelper (>= 11~) , python3-setuptools-git , python3-yaml , xmlto +Recommends: python3-systemd Standards-Version: 4.2.1 Homepage: https://salsa.debian.org/freedombox-team/plinth Vcs-Git: https://salsa.debian.org/freedombox-team/plinth.git diff --git a/plinth/__main__.py b/plinth/__main__.py index 8e4ea3544..ec71646e6 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -176,6 +176,17 @@ def configure_django(): } } + try: + importlib.import_module('systemd.journal') + except ModuleNotFoundError: + pass + else: + logging_configuration['handlers']['journal'] = { + 'class': 'systemd.journal.JournalHandler' + } + logging_configuration['root']['handlers'].append('journal') + + templates = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates',