improved systemd service log

This commit is contained in:
Daniel Langbein 2024-08-31 12:07:00 +02:00
parent b7cb54dc93
commit c6f4deb733
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -35,8 +35,20 @@
]; ];
script = '' script = ''
set -eu -o pipefail set -eu -o pipefail
/jc-config/docker-compose pull
/jc-config/docker-compose up -d --wait # We use
# 2> >(sed 's/^/<3> /' >&2)
# to prefix each line of stderr with
# "<3> "
# Source: https://superuser.com/a/882025/919675
#
# With this prefix, the stderr output is treated as error messages by systemd.
# See https://www.freedesktop.org/software/systemd/man/latest/sd-daemon.html
# They can be viewed with
# journalctl -b -u Jinja-Compose.service
/jc-config/docker-compose pull 2> >(sed 's/^/<3> /' >&2)
/jc-config/docker-compose up -d --wait 2> >(sed 's/^/<3> /' >&2)
''; '';
}; };
} }