FreedomBox/data/usr/lib/systemd/system/plinth.service
Sunil Mohan Adapa cc626be728
service: Capture stdout/stderr when running as systemd unit
- Avoid duplicate log messages by not logging to console when running as systemd
unit.

- Retain normal logging when running on the terminal.

Tests:

- When running as systemd unit, output to stdin/stdout is captured in systemd
journal and visible with 'sudo freedombox-logs'.

- When running on terminal manually with 'sudo --user plinth ./run --develop'
both log messages and stdout/stderr prints() are visible.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-03-31 07:48:38 -04:00

27 lines
619 B
Desktop File

# SPDX-License-Identifier: AGPL-3.0-or-later
[Unit]
Description=FreedomBox Service (Plinth)
Documentation=man:plinth(1)
After=network.target
StartLimitIntervalSec=0
# Uploaded files in /var/tmp/ are shared with FreedomBox privileged service.
JoinsNamespaceOf=freedombox-privileged.service
[Service]
Type=notify
ExecStart=/usr/bin/plinth
TimeoutSec=300s
Restart=on-failure
RestartSec=5
ExecReload=/bin/kill -HUP $MAINPID
User=plinth
Group=plinth
NotifyAccess=main
# Uploaded files in /var/tmp/ are shared with FreedomBox privileged service by
# joining namespaces.
PrivateTmp=yes
[Install]
WantedBy=multi-user.target