blockhosts.log problem.

Hi.

- FreeBSD 5.2 STABLE
- Python 2.4.2 (#2, Oct 24 2005, 23:12:34)
- Part of cat /etc/hosts.allow
sshd : ALL : spawn (/usr/local/bin/blockhosts.py --verbose >> /var/log/blockhosts.log 2>&1 )& : allow
vsftpd : ALL : spawn (/usr/local/bin/blockhosts.py --verbose >> /var/log/blockhosts.log 2>&1 )& : allow
( of course there is no such spaces in hosts.allow in this lines)
For some unknown reason I keep recieving
'env: python: No such file or directory' in /var/log/blockhosts.log
What might be the reason of it. Everything work well for some time, but now...

Python install issues?

If you do a search on the web for:
env: python: No such file or directory
you will find many different reasons for this.

It has nothing to do with blockhosts, has to do with the way python was installed on your system.

What happens if you run this on your command line?
env python

If the python 2.3 or later does not start up, blockhosts.py won't work.

You may need to use the

python setup.py install --force

command in blockhosts with additional options to make this work, I am afraid I don't know more to help on this issue. The first line in blockhosts.py uses the standard idiom to kick off python on Unix-like systems
#!/usr/bin/env python

Well, I do search on the

Well, I do search on the web, but ...
Anyway, the output of env python :
[code]
[11:16pm][root@elsa][/usr/local/bin]#env python
Python 2.4.2 (#2, Oct 24 2005, 23:12:34)
[GCC 3.4.2 [FreeBSD] 20040728] on freebsd5
Type "help", "copyright", "credits" or "license" for more information.
>>>
[/code]

I've tried some different combination of the first line from /usr/local/bin/blockhosts.py ,
for ex. #!/usr/bin/env python2 or
#!/usr/local/bin/env python - (where python is located) but nothing worked.
The odd thing is that : when I write '/usr/local/bin/blockhosts.py --verbose' i get the response ,
for ex.
[code]
blockhosts 1.0.0 started: 2005-11-02 23:23:18
... will discard all host entries older than 2005-09-03 23:23
... load blockfile: loading from file: /etc/hosts.allow
... found both markers, count of hosts being watched: 10
... securelog, loading from file: /var/log/auth.log 34919
... securelog, loading from file: /var/log/vsftpd.log 61924
... updates: counts: hosts to block: 4; hosts being watched: 11
[/code]
So it shows, that the script is working when I start it manually, but, the respawn and logging from hosts.allow is not working.

Anyway thanks 4 your replay.
Regards.

edit /usr/bin/blockhosts.py

Hi,

I got the same problem and the solution was to open /usr/bin/blockhosts.py and change #!/usr/bin/env python to #!/usr/local/bin/python.

To find Python, type: whereis python

freebsd# whereis python
python: /usr/local/bin/python /usr/local/man/man1/python.1.gz /usr/ports/lang/python
freebsd#