我正在使用 Raspbian Jessie Lite。我已将无人值守升级配置为详细信息在这里,但我似乎没有收到任何电子邮件。
今天早上安装了更新:
2016-04-03 06:52:55,942 INFO Initial blacklisted packages:
2016-04-03 06:52:55,945 INFO Starting unattended upgrades script
2016-04-03 06:52:55,945 INFO Allowed origins are: ['o=Raspbian,n=jessie']
2016-04-03 06:54:47,863 INFO Packages that will be upgraded: apt apt-utils gnupg gpgv initramfs-tools libapt-inst1.5 libapt-pkg4.12 libc-bin libc-dev-bin libc6 libc6-dbg libc6-dev libcairo-gobject2 libcairo2 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgudev-1.0-0 libhogweed2 libnettle4 libpcre3 libsystemd0 libudev1 locales multiarch-support systemd systemd-sysv tzdata udev
2016-04-03 06:54:47,874 INFO Writing dpkg log to '/var/log/unattended-upgrades/unattended-upgrades-dpkg_2016-04-03_06:54:47.868197.log'
2016-04-03 06:58:01,365 INFO All upgrades installed
我已经安装了所需的软件包:
unattended-upgrades/stable,now 0.81+rpi1 all [installed]
apt-listchanges/stable,now 2.85.13+nmu1 all [installed]
bsd-mailx/stable,now 8.1.2-0.20141216cvs-2 armhf [installed]
mailx
发送电子邮件效果很好(我已经设置了 postfix,所有本地邮件都会传递到真实的邮件帐户;从今天早上开始,邮件日志中没有任何内容,除了我刚刚发送的测试电子邮件)。
邮件已开启:
# /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Mail "root";
不知道如何进一步调试:(
答案1
我不觉得自己是个傻子吗...
danny@raspberrypi:~ $ cat /etc/apt/apt.conf.d/50unattended-upgrades | grep Mail
Unattended-Upgrade::Mail "root";
// is to always send a mail if Unattended-Upgrade::Mail is set
Unattended-Upgrade::MailOnlyOnError "true";
仅在出现错误时发送电子邮件...这不是默认设置!我想知道这是怎么发生的;然后检查我的 Pi 设置脚本中的内容...
sudo sed -i 's/^\/\/Unattended-Upgrade::Mail/Unattended-Upgrade::Mail/g' /etc/apt/apt.conf.d/50unattended-upgrades
此行旨在取消注释发送邮件的行,而不是仅在出现错误时发送邮件。哎呀!