No subject


Sat Sep 6 14:44:12 PDT 2008


Red Hat Linux: Red Hat 9 built Python2.2 in UCS-4 mode and hacked
        Tcl to support it. To compile Python2.3 with Tkinter, you will
        need to pass --enable-unicode=ucs4 flag to ./configure.

        There's an executable /usr/bin/python which is Python
        1.5.2 on most older Red Hat installations; several key Red Hat tools
        require this version.  Python 2.1.x may be installed as
        /usr/bin/python2.  The Makefile installs Python as
        /usr/local/bin/python, which may or may not take precedence
        over /usr/bin/python, depending on how you have set up $PATH.

I noticed before with other passes problem messages relating to Tkinter so I will take
their suggestion for ./configure.

#make clean | tee ~paul/public_html/Python2.5.4/step1.txt;\
   ./configure --enable-unicode=ucs4 | tee ~paul/public_html/Python2.5.4/step2.txt;\
   make | tee ~paul/public_html/Python2.5.4/step3.txt;\
   make test | tee ~paul/public_html/Python2.5.4/step3.txt;\
   make altinstall | tee ~paul/public_html/Python2.5.4/step4.txt

Results of the 4 steps can be read:
<http://eucleides.com/~paul/Python2.5.4/step1.txt> (empty as expected)
<http://eucleides.com/~paul/Python2.5.4/step2.txt>
<http://eucleides.com/~paul/Python2.5.4/step3.txt>
<http://eucleides.com/~paul/Python2.5.4/step4.txt>

# rpm -ivh DenyHosts-2.6-python2.5.rpm | tee ~paul/public_html/Python2.5.4/step5.txt
error: Failed dependencies:
        python = 2.5 is needed by DenyHosts-2.6-0

(which is expected, since no rpm for python 2.5 is available for Fedora Core 1)

# uname -a
Linux Beaker.eucleides.com 2.4.22-1.2199.8.legacy.nptl #1 Fri Mar 3 21:40:24 EST 2006
i686 athlon i386 GNU/Linux

rpm -ivh --nodeps DenyHosts-2.6-python2.5.rpm | tee
~paul/public_html/Python2.5.4/step5.txt

This had the desired effect of placing the DenyHosts modules into the python2.5
site-packages directory since I wasn't sure about how to modify the instructions in
the usr/share/denyhosts/README.txt that says:

# python setup.py install

Possibly I could have:

# /usr/local/bin/python3.0 setup.py install

edit denyhosts.cfg, note edits:

[root at Beaker denyhosts]# diff denyhosts.cfg denyhosts.cfg-dist
58,59c58
< # PURGE_DENY =
< PURGE_DENY = 4w
---
> PURGE_DENY =
79d77
< PURGE_THRESHOLD = 2
94d91
< BLOCK_SERVICE = ALL
96c93
< # BLOCK_SERVICE  = sshd
---
> BLOCK_SERVICE  = sshd
132c129
< DENY_THRESHOLD_ROOT = 2
---
> DENY_THRESHOLD_ROOT = 1
222c219
< ADMIN_EMAIL = admin at eucleides.com
---
> ADMIN_EMAIL =
233,234c230
< #SMTP_HOST = localhost
< SMTP_HOST = beaker.eucleides.com
---
> SMTP_HOST = localhost
254,255c250
< #SMTP_FROM = DenyHosts <nobody at localhost>
< SMTP_FROM = DenyHosts <DenyHosts at beaker.eucleides.com>
---
> SMTP_FROM = DenyHosts <nobody at localhost>
291c286
< SYSLOG_REPORT=YES
---
> #SYSLOG_REPORT=YES
539d533
< SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
624d617
< SYNC_DOWNLOAD_RESILIENCY = 2h

Note the following from http://denyhosts.sourceforge.net/faq.html

<quote>
My server has an earlier version of Python installed, can I still run DenyHosts?

DenyHosts requires Python v2.3 or later. If you are using an earlier version of Python
then you should install a newer version of Python on your system. Multiple versions of
Python can safely co-exist on your server so you do not need to worry about breaking
any dependencies. You should obtain the latest version of Python and install it on
your system. Depending on the method of download, your latest Python executable is
typically installed in /usr/local/bin or /usr/bin.

If you downloaded version Python v2.3, then the executable is python2.3. If you
downloaded Python v2.4 then the executable is python2.4.

If you will be using DenyHosts in daemon mode, then you will need to edit the
daemon-control-dist script. You will want to copy this file to "daemon-control" such
that future DenyHosts upgrades will preserve your edits.

$ cp daemon-control-dist daemon-control

Assuming you installed Python v2.4 and the executable is in /usr/bin then you will
need to make the following changes to your daemon-control script:

Line # 	From 	To
1 	#!/usr/bin/env python 	#!/usr/bin/python2.4
18 	PYTHON_BIN = "/usr/bin/env python" 	PYTHON_BIN = "/usr/bin/python2.4"

You may need to modify the above paths to reflect the actual installation location and
version of Python that you installed.
</quote>

edit daemon-control, note edits:

[root at Beaker denyhosts]# diff daemon-control daemon-control-dist
1c1
< #!/usr/local/bin/python2.5
---
> #!/usr/bin/env python
18c18
< PYTHON_BIN      = "/usr/local/bin/python2.5"
---
> PYTHON_BIN      = "/usr/bin/env python"

One more thing; verify that denyhosts.py is correct for python 2.5

[root at Beaker denyhosts]# rpm2cpio ~/bin/DenyHosts-2.6-python2.5.rpm |cpio -ivd
./usr/bin/denyhosts.py
./usr/bin/denyhosts.py
452 blocks
[root at Beaker denyhosts]# diff ./usr/bin/denyhosts.py /usr/bin/denyhosts.py
[root at Beaker denyhosts]#

edit denyhosts.cfg, note edits:

[root at Beaker denyhosts]# diff denyhosts.cfg denyhosts.cfg-dist
58,59c58
< # PURGE_DENY =
< PURGE_DENY = 4w
---
> PURGE_DENY =
79d77
< PURGE_THRESHOLD = 2
94d91
< BLOCK_SERVICE = ALL
96c93
< # BLOCK_SERVICE  = sshd
---
> BLOCK_SERVICE  = sshd
132c129
< DENY_THRESHOLD_ROOT = 2
---
> DENY_THRESHOLD_ROOT = 1
222c219
< ADMIN_EMAIL = admin at eucleides.com
---
> ADMIN_EMAIL =
233,234c230
< #SMTP_HOST = localhost
< SMTP_HOST = beaker.eucleides.com
---
> SMTP_HOST = localhost
254,255c250
< #SMTP_FROM = DenyHosts <nobody at localhost>
< SMTP_FROM = DenyHosts <DenyHosts at beaker.eucleides.com>
---
> SMTP_FROM = DenyHosts <nobody at localhost>
291c286
< SYSLOG_REPORT=YES
---
> #SYSLOG_REPORT=YES
539d533
< SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
624d617
< SYNC_DOWNLOAD_RESILIENCY = 2h

Test in daemon mode:

[root at Beaker denyhosts]# ./daemon-control start
starting DenyHosts:    /usr/local/bin/python2.5 /usr/bin/denyhosts.py --daemon
--config=/usr/share/denyhosts/denyhosts.cfg
Traceback (most recent call last):
  File "/usr/bin/denyhosts.py", line 5, in <module>
    import DenyHosts.python_version
ImportError: No module named DenyHosts.python_version

Once more starting it using the specific python:

[root at Beaker denyhosts]# /usr/local/bin/python2.5 daemon-control start
starting DenyHosts:    /usr/local/bin/python2.5 /usr/bin/denyhosts.py --daemon
--config=/usr/share/denyhosts/denyhosts.cfg
Traceback (most recent call last):
  File "/usr/bin/denyhosts.py", line 5, in <module>
    import DenyHosts.python_version
ImportError: No module named DenyHosts.python_version

Why does it not substitute "2.5" for "python_version"?

daemon-control has this line in it correctly:

PYTHON_BIN      = "/usr/local/bin/python2.5"

The modules are here:

[root at Beaker denyhosts]# ls -l /usr/lib/python2.5/site-packages/
total 4
drwxr-xr-x  2 root root 4096 Feb 27 15:01 DenyHosts

But maybe they are supposed to be in /usr/local/lib similar to the way they were
installed using the 2.6 and 3.0 installations were.

Sure enough, nothing in there:

[root at Beaker denyhosts]# ls -l /usr/local/lib/python2.5/site-packages/
total 4
-rw-r--r--  1 root root 119 Feb 27 13:40 README

So, the denyhosts rpm didn't put them there.

Just a guess - copy them there?

# cp -a /usr/lib/python2.5/site-packages/DenyHosts
/usr/local/lib/python2.5/site-packages/

OK, try again:

[root at Beaker denyhosts]# ./daemon-control start
starting DenyHosts:    /usr/local/bin/python2.5 /usr/bin/denyhosts.py --daemon
--config=/usr/share/denyhosts/denyhosts.cfg

Voila! It looks like it started the daemon.

[root at Beaker bin]# ps aux | grep deny
root      4457  0.0  1.1 10428 5600 ?        S    18:03   0:00
/usr/local/bin/python2.5 /usr/bin/denyhosts.py --daemon
--config=/usr/share/denyhosts/denyhosts.cfg

So it looks like it is going.

And this looks very promising, an e-mail arrived!


RFC822 Message body
Return-Path: <DenyHosts at beaker.eucleides.com>
Received: from Beaker.eucleides.com (Beaker.eucleides.com [127.0.0.1])
by Beaker.eucleides.com (8.12.11.20060308/8.12.11) with ESMTP id n1S23Kpl004454
for <admin at eucleides.com>; Fri, 27 Feb 2009 18:03:20 -0800
Message-Id: <200902280203.n1S23Kpl004454 at Beaker.eucleides.com>
From: DenyHosts <DenyHosts at beaker.eucleides.com>
To: admin at eucleides.com
Subject: DenyHosts Report
Date: Fri, 27 Feb 2009 18:03:20 -0800

Added the following hosts to /etc/hosts.deny:

88.149.158.70 (88-149-158-70.vps.virtuo.it)
190.154.226.130 (mail.aymdealer.com)
69.31.87.187 (colo-69-31-87-187.pilosoft.com)
222.186.191.80 (unknown)
69.13.198.195 (unknown)
78.24.133.100 (chez.laurent.3)
125.76.233.50 (unknown)
89.108.74.77 (unknown-3691.agava.net)
200.62.141.62 (mail.maximixe.net)
117.34.70.21 (unknown)
58.211.82.139 (unknown)
202.106.125.27 (unknown)
77.243.200.4 (unknown)

----------------------------------------------------------------------


Now a little touchup so that the daemon starts automatically.

# ln -s /usr/share/denyhosts/daemon-control denyhosts

# chkconfig --add denyhosts

# chkconfig --list denyhosts
denyhosts       0:off   1:off   2:on    3:on    4:on    5:on    6:off

So, the problem was with the installation of DenyHosts where there are multiple Python
installations.

Now as a good guy, I need to impart the two days of work to the DenyHosts people so
that either the rpm or the tarball can be fixed for the case when one has multiple
Python versions installed.


More information about the linux-list mailing list