自从更新到 11.04 以来,我一直收到来自“Anacron”的消息,其中有一些错误。实际上,有两种类型的消息。
第一种类型如下:
/etc/cron.daily/logrotate:
/etc/denyhosts.conf: 28: SECURE_LOG: not found
/etc/denyhosts.conf: 36: HOSTS_DENY: not found
/etc/denyhosts.conf: 60: PURGE_DENY: not found
/etc/denyhosts.conf: 95: BLOCK_SERVICE: not found
/etc/denyhosts.conf: 110: DENY_THRESHOLD_INVALID: not found
/etc/denyhosts.conf: 121: DENY_THRESHOLD_VALID: not found
/etc/denyhosts.conf: 131: DENY_THRESHOLD_ROOT: not found
/etc/denyhosts.conf: 142: DENY_THRESHOLD_RESTRICTED: not found
/etc/denyhosts.conf: 155: WORK_DIR: not found
/etc/denyhosts.conf: 200: LOCK_FILE: not found
/etc/denyhosts.conf: 221: ADMIN_EMAIL: not found
/etc/denyhosts.conf: 232: SMTP_HOST: not found
/etc/denyhosts.conf: 233: SMTP_PORT: not found
/etc/denyhosts.conf: 252: Syntax error: newline unexpected
error: error running non-shared postrotate script for /var/log/denyhosts of '/var/log/denyhosts '
run-parts: /etc/cron.daily/logrotate exited with return code 1
这些是 /etc/denyhosts.conf 中的相应条目
SECURE_LOG = /var/log/auth.log
HOSTS_DENY = /etc/hosts.deny
PURGE_DENY = 1w
BLOCK_SERVICE = sshd
DENY_THRESHOLD_INVALID = 5
DENY_THRESHOLD_VALID = 10
DENY_THRESHOLD_ROOT = 1
DENY_THRESHOLD_RESTRICTED = 1
WORK_DIR = /var/lib/denyhosts
LOCK_FILE = /var/run/denyhosts.pid
ADMIN_EMAIL = root@localhost
SMTP_HOST = localhost
SMTP_PORT = 25
在我看来它们都很好。
此外,同一文件的第 251-253 行如下:
#
SMTP_FROM = DenyHosts <DenyHosts@localhost>
#
所以我也没有看到“意外的换行符”......
我从“Anacron”收到的另一种邮件类型是:
/etc/cron.daily/popularity-contest:
readline() on closed filehandle FILES at /usr/sbin/popularity-contest line 104.
(前一句重复了几十遍)
这些消息有什么提示吗?
答案1
拒绝主机错误似乎是Debian 错误 #608672。似乎denyhosts的logrotate脚本试图/etc/denyhosts.conf
作为shell脚本执行来访问配置变量。
虽然您的配置文件对于denyhosts本身来说没有问题,但它会导致logrotate脚本失败。看起来这个问题已经在11.10版本中修复了,但修复还没有作为11.04的更新发布。
您应该能够通过删除文件每行等号前后的空格来解决该问题/etc/denyhosts.conf
。
答案2
人气竞赛邮件是 10.10 中的一个已知错误,在 11.10 中仍未修复 - 运行
sudo dpkg-reconfigure 流行度竞赛
要解决这个问题。
问候约翰