bundles/apt: fix logging for upgrade-and-reboot

This commit is contained in:
Franzi 2021-01-23 11:32:35 +01:00
parent 51101fc615
commit c41ee0f806
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -3,17 +3,15 @@
# With systemd, we can force logging to the journal. This is better than
# spamming the world with cron mails. You can then view these logs using
# "journalctl -rat upgrade-and-reboot".
if [[ "$1" != '-w' ]]
if which logger >/dev/null 2>&1
then
if which systemd-cat >/dev/null 2>&1
then
if [[ "$1" != "is-logging" ]]
then
exec systemd-cat -t upgrade-and-reboot "$0" is-logging "$@"
else
shift
fi
fi
# Dump stdout to logger, which will then put everything into the
# journal.
exec 1> >(logger -t upgrade-and-reboot -p user.info)
# Make stdout and stderr the same. We don't care about the
# distinction anyway.
exec 2>&1
fi
statusfile="/var/tmp/unattended_upgrades.status"