Since update to 11.04, I keep receiving messages from 'Anacron', with some errors. Two types of messages, actually.
The first of those types is like:
/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
These are the corresponding entries in /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
All of them seem fine to me.
Also, lines 251-253 in the same file go like:
#
SMTP_FROM = DenyHosts <DenyHosts@localhost>
#
So I don't see the "unexpected newline", either…
The other type of mail message I get from 'Anacron' is:
/etc/cron.daily/popularity-contest:
readline() on closed filehandle FILES at /usr/sbin/popularity-contest line 104.
(with the former line repeated some tens times)
Any hint on these messages?
Best Answer
The denyhosts error seems to be Debian Bug #608672. It seems that the logrotate script for denyhosts tries to execute
/etc/denyhosts.conf
as a shell script to access the configuration variables.While your configuration file is fine for denyhosts itself, it causes the logrotate script to fail. It looks like the problem has been fixed for the 11.10 release but the fix has not yet been released as an update for 11.04.
You should be able to work around the problem by removing the spaces before and after the equals sign on each line of your
/etc/denyhosts.conf
file.