bundles/apt: fix logging for upgrade-and-reboot
This commit is contained in:
parent
51101fc615
commit
c41ee0f806
1 changed files with 8 additions and 10 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue