Package: denyhosts
Version: 2.6-10
Severity: normal

Dear Maintainer,

on one of my systems, denyhosts fails to start. Worse yet,
when starting the init script reports "ok" and nothing is 
written either on the screen or on any log file.

But it does not really start, as can easily be verified by 
means of 'ps' or by running:

# service denyhosts status
[FAIL] denyhosts is not running ... failed!

Running in foreground (denyhosts --foreground) I've got 
the error:

Could not find environment variable: HOSTNAME

I've verified that indeed on my system that var is not 
defined. Defining the variable solves the problem.

Here is a trivial patch to the init script which just does 
that:

# diff -u denyhosts.orig denyhosts
--- denyhosts.orig      2011-08-17 10:21:17.000000000 +0200
+++ denyhosts   2013-12-11 15:52:07.740887778 +0100
@@ -33,6 +33,8 @@
 CONFIG=/etc/denyhosts.conf
 FLAGS="--purge --config=$CONFIG"
 
+export HOSTNAME="$(hostname)"
+
 # Function that starts the daemon/service.
 d_start() {
        # Gracefully exit if the package has been removed.



P.S.: this seems to be related to similar bug reported on 
other distributions:

https://bugs.launchpad.net/ubuntu/+source/denyhosts/+bug/87898

https://bugzilla.redhat.com/show_bug.cgi?id=428440

ecc.: 
https://www.google.com/search?q=denyhosts%20Could%20not%20find%20environment%20variable%3A%20HOSTNAME


P.P.S.:

further investigation allowed me to track down the source of
the problem to this line that I had in the config file:

SMTP_SUBJECT = DenyHosts Report from $[HOSTNAME]

It used to work with previous version, and still does if
the HOSTNAME var is defined in the init script.


-- System Information:
Debian Release: 7.2
  APT prefers stable
  APT policy: (900, 'stable'), (500, 'stable-updates'), (190, 'testing'), (180, 
'unstable'), (7, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-0.bpo.2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages denyhosts depends on:
ii  lsb-base  4.1+Debian8+deb7u1
ii  python    2.7.3-4+deb7u1

denyhosts recommends no packages.

denyhosts suggests no packages.

-- Configuration Files:
/etc/denyhosts.conf [Errno 13] Permission denied: u'/etc/denyhosts.conf'



-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to