Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
denyhost does not start with init.d script (Solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
reup
Guru
Guru


Joined: 13 May 2005
Posts: 419
Location: Nederland

PostPosted: Mon Jul 18, 2011 9:30 am    Post subject: denyhost does not start with init.d script (Solved) Reply with quote

hello all

I am running a current gentoo, with baselayout 2 and openrc. denyhosts is version 2.6-r4 (the latest at this time) and I encounter a strange problem

denyhost does not start if called by init.d script bu can start if the command is called manually

this is the script in /etc/init.d/denyhosts
Code:
cat /etc/init.d/denyhosts
#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/denyhosts/files/denyhosts.init,v 1.6 2010/10/07 12:45:33 darkside Exp $

opts="depend start stop"

depend() {
   use logger sshd
}

start() {
   ebegin "Starting DenyHosts daemon"
   start-stop-daemon --start --exec /usr/bin/denyhosts.py --pidfile /var/run/denyhosts.pid -- --daemon -c /etc/denyhosts.conf
   eend $?
}

stop() {
   ebegin "Stopping DenyHosts daemon"
   start-stop-daemon --quiet --stop --pidfile /var/run/denyhosts.pid
   eend $?
}

this is the log from /var/log/denyhosts when running /etc/init.d/denyhosts start

Code:
2011-07-18 11:23:27,339 - denyhosts   : INFO     DenyHosts launched with the following args:
2011-07-18 11:23:27,364 - denyhosts   : INFO        /usr/bin/denyhosts.py-2.6 --daemon -c /etc/denyhosts.conf
2011-07-18 11:23:27,365 - prefs       : INFO     DenyHosts configuration settings:
2011-07-18 11:23:27,368 - prefs       : INFO        ADMIN_EMAIL: [xxxxxx@yahoo.com]
2011-07-18 11:23:27,369 - prefs       : INFO        AGE_RESET_INVALID: [864000]
2011-07-18 11:23:27,370 - prefs       : INFO        AGE_RESET_RESTRICTED: [2160000]
2011-07-18 11:23:27,370 - prefs       : INFO        AGE_RESET_ROOT: [432000]
2011-07-18 11:23:27,372 - prefs       : INFO        AGE_RESET_VALID: [432000]
2011-07-18 11:23:27,373 - prefs       : INFO        ALLOWED_HOSTS_HOSTNAME_LOOKUP: [no]
2011-07-18 11:23:27,374 - prefs       : INFO        BLOCK_SERVICE: [sshd]
2011-07-18 11:23:27,376 - prefs       : INFO        DAEMON_LOG: [/var/log/denyhosts]
2011-07-18 11:23:27,377 - prefs       : INFO        DAEMON_LOG_MESSAGE_FORMAT: [%(asctime)s - %(name)-12s: %(levelname)-8s %(message)s]
2011-07-18 11:23:27,378 - prefs       : INFO        DAEMON_LOG_TIME_FORMAT: [None]
2011-07-18 11:23:27,378 - prefs       : INFO        DAEMON_PURGE: [3600]
2011-07-18 11:23:27,380 - prefs       : INFO        DAEMON_SLEEP: [30]
2011-07-18 11:23:27,381 - prefs       : INFO        DENY_THRESHOLD_INVALID: [5]
2011-07-18 11:23:27,382 - prefs       : INFO        DENY_THRESHOLD_RESTRICTED: [1]
2011-07-18 11:23:27,384 - prefs       : INFO        DENY_THRESHOLD_ROOT: [1]
2011-07-18 11:23:27,385 - prefs       : INFO        DENY_THRESHOLD_VALID: [5]
2011-07-18 11:23:27,386 - prefs       : INFO        FAILED_ENTRY_REGEX: [None]
2011-07-18 11:23:27,386 - prefs       : INFO        FAILED_ENTRY_REGEX2: [None]
2011-07-18 11:23:27,388 - prefs       : INFO        FAILED_ENTRY_REGEX3: [None]
2011-07-18 11:23:27,389 - prefs       : INFO        FAILED_ENTRY_REGEX4: [None]
2011-07-18 11:23:27,390 - prefs       : INFO        FAILED_ENTRY_REGEX5: [None]
2011-07-18 11:23:27,392 - prefs       : INFO        FAILED_ENTRY_REGEX6: [None]
2011-07-18 11:23:27,393 - prefs       : INFO        FAILED_ENTRY_REGEX7: [None]
2011-07-18 11:23:27,393 - prefs       : INFO        HOSTNAME_LOOKUP: [YES]
2011-07-18 11:23:27,396 - prefs       : INFO        HOSTS_DENY: [/etc/hosts.deny]
2011-07-18 11:23:27,397 - prefs       : INFO        LOCK_FILE: [/var/run/denyhosts.pid]
2011-07-18 11:23:27,398 - prefs       : INFO        PLUGIN_DENY: [None]
2011-07-18 11:23:27,398 - prefs       : INFO        PLUGIN_PURGE: [None]
2011-07-18 11:23:27,401 - prefs       : INFO        PURGE_DENY: [None]
2011-07-18 11:23:27,401 - prefs       : INFO        PURGE_THRESHOLD: [0]
2011-07-18 11:23:27,404 - prefs       : INFO        RESET_ON_SUCCESS: [no]
2011-07-18 11:23:27,405 - prefs       : INFO        SECURE_LOG: [/var/log/messages]
2011-07-18 11:23:27,406 - prefs       : INFO        SMTP_DATE_FORMAT: [%a, %d %b %Y %H:%M:%S %z]
2011-07-18 11:23:27,406 - prefs       : INFO        SMTP_FROM: [DenyHosts <xxxxx.com>]
2011-07-18 11:23:27,408 - prefs       : INFO        SMTP_HOST: [localhost]
2011-07-18 11:23:27,409 - prefs       : INFO        SMTP_PASSWORD: [None]
2011-07-18 11:23:27,410 - prefs       : INFO        SMTP_PORT: [25]
2011-07-18 11:23:27,412 - prefs       : INFO        SMTP_SUBJECT: [DenyHosts Report]
2011-07-18 11:23:27,413 - prefs       : INFO        SMTP_USERNAME: [None]
2011-07-18 11:23:27,414 - prefs       : INFO        SSHD_FORMAT_REGEX: [None]
2011-07-18 11:23:27,414 - prefs       : INFO        SUCCESSFUL_ENTRY_REGEX: [None]
2011-07-18 11:23:27,416 - prefs       : INFO        SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS: [YES]
2011-07-18 11:23:27,417 - prefs       : INFO        SYNC_DOWNLOAD: [yes]
2011-07-18 11:23:27,418 - prefs       : INFO        SYNC_DOWNLOAD_RESILIENCY: [18000]
2011-07-18 11:23:27,420 - prefs       : INFO        SYNC_DOWNLOAD_THRESHOLD: [3]
2011-07-18 11:23:27,421 - prefs       : INFO        SYNC_INTERVAL: [3600]
2011-07-18 11:23:27,422 - prefs       : INFO        SYNC_SERVER: [None]
2011-07-18 11:23:27,424 - prefs       : INFO        SYNC_UPLOAD: [yes]
2011-07-18 11:23:27,425 - prefs       : INFO        SYSLOG_REPORT: [no]
2011-07-18 11:23:27,426 - prefs       : INFO        WORK_DIR: [/var/lib/denyhosts]
2011-07-18 11:23:27,478 - denyhosts   : INFO     restricted: set([])
2011-07-18 11:23:27,480 - denyhosts   : INFO     Processing log file (/var/log/messages) from offset (2207473)
2011-07-18 11:23:27,524 - denyhosts   : INFO     launching DenyHosts daemon (version 2.6)...
2011-07-18 11:23:27,549 - denyhosts   : INFO     DenyHosts daemon is now running, pid: 15295
2011-07-18 11:23:27,556 - denyhosts   : INFO     send daemon process a TERM signal to terminate cleanly
2011-07-18 11:23:27,557 - denyhosts   : INFO       eg.  kill -TERM 15295
2011-07-18 11:23:27,587 - denyhosts   : INFO     monitoring log: /var/log/messages
2011-07-18 11:23:27,587 - denyhosts   : INFO     sync_time: 3600
2011-07-18 11:23:27,588 - denyhosts   : INFO     purging of /etc/hosts.deny is disabled
2011-07-18 11:23:27,588 - denyhosts   : INFO     denyhosts synchronization disabled
2011-07-18 11:23:29,124 - denyhosts   : INFO     DenyHosts daemon is shutting down


last line tells that denyhosts is shutting down


no pid running :
Code:
ps aux | grep denyhost
root     15346  0.0  0.0   8304   752 pts/1    S+   11:24   0:00 grep --colour=auto denyhost



so it does not work, but if I take the starting line from the script and run it :
Code:
start-stop-daemon --start --exec /usr/bin/denyhosts.py --pidfile /var/run/denyhosts.pid -- --daemon -c /etc/denyhosts.conf


this is the log :
Code:
2011-07-18 11:26:13,965 - denyhosts   : INFO     DenyHosts launched with the following args:
2011-07-18 11:26:13,976 - denyhosts   : INFO        /usr/bin/denyhosts.py-2.6 --daemon -c /etc/denyhosts.conf
2011-07-18 11:26:13,977 - prefs       : INFO     DenyHosts configuration settings:
2011-07-18 11:26:13,978 - prefs       : INFO        ADMIN_EMAIL: [xxx@yahoo.com]
2011-07-18 11:26:13,978 - prefs       : INFO        AGE_RESET_INVALID: [864000]
2011-07-18 11:26:13,979 - prefs       : INFO        AGE_RESET_RESTRICTED: [2160000]
2011-07-18 11:26:13,979 - prefs       : INFO        AGE_RESET_ROOT: [432000]
2011-07-18 11:26:13,980 - prefs       : INFO        AGE_RESET_VALID: [432000]
2011-07-18 11:26:13,980 - prefs       : INFO        ALLOWED_HOSTS_HOSTNAME_LOOKUP: [no]
2011-07-18 11:26:13,981 - prefs       : INFO        BLOCK_SERVICE: [sshd]
2011-07-18 11:26:13,981 - prefs       : INFO        DAEMON_LOG: [/var/log/denyhosts]
2011-07-18 11:26:13,982 - prefs       : INFO        DAEMON_LOG_MESSAGE_FORMAT: [%(asctime)s - %(name)-12s: %(levelname)-8s %(message)s]
2011-07-18 11:26:13,982 - prefs       : INFO        DAEMON_LOG_TIME_FORMAT: [None]
2011-07-18 11:26:13,983 - prefs       : INFO        DAEMON_PURGE: [3600]
2011-07-18 11:26:13,983 - prefs       : INFO        DAEMON_SLEEP: [30]
2011-07-18 11:26:13,984 - prefs       : INFO        DENY_THRESHOLD_INVALID: [5]
2011-07-18 11:26:13,985 - prefs       : INFO        DENY_THRESHOLD_RESTRICTED: [1]
2011-07-18 11:26:13,985 - prefs       : INFO        DENY_THRESHOLD_ROOT: [1]
2011-07-18 11:26:13,986 - prefs       : INFO        DENY_THRESHOLD_VALID: [5]
2011-07-18 11:26:13,986 - prefs       : INFO        FAILED_ENTRY_REGEX: [None]
2011-07-18 11:26:13,987 - prefs       : INFO        FAILED_ENTRY_REGEX2: [None]
2011-07-18 11:26:13,987 - prefs       : INFO        FAILED_ENTRY_REGEX3: [None]
2011-07-18 11:26:13,988 - prefs       : INFO        FAILED_ENTRY_REGEX4: [None]
2011-07-18 11:26:13,989 - prefs       : INFO        FAILED_ENTRY_REGEX5: [None]
2011-07-18 11:26:13,989 - prefs       : INFO        FAILED_ENTRY_REGEX6: [None]
2011-07-18 11:26:13,990 - prefs       : INFO        FAILED_ENTRY_REGEX7: [None]
2011-07-18 11:26:13,990 - prefs       : INFO        HOSTNAME_LOOKUP: [YES]
2011-07-18 11:26:13,991 - prefs       : INFO        HOSTS_DENY: [/etc/hosts.deny]
2011-07-18 11:26:13,991 - prefs       : INFO        LOCK_FILE: [/var/run/denyhosts.pid]
2011-07-18 11:26:13,992 - prefs       : INFO        PLUGIN_DENY: [None]
2011-07-18 11:26:13,992 - prefs       : INFO        PLUGIN_PURGE: [None]
2011-07-18 11:26:13,993 - prefs       : INFO        PURGE_DENY: [None]
2011-07-18 11:26:13,993 - prefs       : INFO        PURGE_THRESHOLD: [0]
2011-07-18 11:26:13,994 - prefs       : INFO        RESET_ON_SUCCESS: [no]
2011-07-18 11:26:13,994 - prefs       : INFO        SECURE_LOG: [/var/log/messages]
2011-07-18 11:26:13,995 - prefs       : INFO        SMTP_DATE_FORMAT: [%a, %d %b %Y %H:%M:%S %z]
2011-07-18 11:26:13,995 - prefs       : INFO        SMTP_FROM: [DenyHosts <xxx.com>]
2011-07-18 11:26:13,996 - prefs       : INFO        SMTP_HOST: [localhost]
2011-07-18 11:26:13,997 - prefs       : INFO        SMTP_PASSWORD: [None]
2011-07-18 11:26:13,997 - prefs       : INFO        SMTP_PORT: [25]
2011-07-18 11:26:13,998 - prefs       : INFO        SMTP_SUBJECT: [DenyHosts Report]
2011-07-18 11:26:13,998 - prefs       : INFO        SMTP_USERNAME: [None]
2011-07-18 11:26:13,999 - prefs       : INFO        SSHD_FORMAT_REGEX: [None]
2011-07-18 11:26:13,999 - prefs       : INFO        SUCCESSFUL_ENTRY_REGEX: [None]
2011-07-18 11:26:14,000 - prefs       : INFO        SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS: [YES]
2011-07-18 11:26:14,000 - prefs       : INFO        SYNC_DOWNLOAD: [yes]
2011-07-18 11:26:14,001 - prefs       : INFO        SYNC_DOWNLOAD_RESILIENCY: [18000]
2011-07-18 11:26:14,001 - prefs       : INFO        SYNC_DOWNLOAD_THRESHOLD: [3]
2011-07-18 11:26:14,002 - prefs       : INFO        SYNC_INTERVAL: [3600]
2011-07-18 11:26:14,002 - prefs       : INFO        SYNC_SERVER: [None]
2011-07-18 11:26:14,003 - prefs       : INFO        SYNC_UPLOAD: [yes]
2011-07-18 11:26:14,003 - prefs       : INFO        SYSLOG_REPORT: [no]
2011-07-18 11:26:14,004 - prefs       : INFO        WORK_DIR: [/var/lib/denyhosts]
2011-07-18 11:26:14,038 - denyhosts   : INFO     restricted: set([])
2011-07-18 11:26:14,040 - denyhosts   : INFO     launching DenyHosts daemon (version 2.6)...
2011-07-18 11:26:14,046 - denyhosts   : INFO     DenyHosts daemon is now running, pid: 15402
2011-07-18 11:26:14,048 - denyhosts   : INFO     send daemon process a TERM signal to terminate cleanly
2011-07-18 11:26:14,048 - denyhosts   : INFO       eg.  kill -TERM 15402
2011-07-18 11:26:14,071 - denyhosts   : INFO     monitoring log: /var/log/messages
2011-07-18 11:26:14,072 - denyhosts   : INFO     sync_time: 3600
2011-07-18 11:26:14,073 - denyhosts   : INFO     purging of /etc/hosts.deny is disabled
2011-07-18 11:26:14,073 - denyhosts   : INFO     denyhosts synchronization disabled

and the ps aux :
Code:
ps aux | grep denyhost
root     15402  0.0  0.3  79292  6296 ?        S    11:26   0:00 /usr/bin/python2.6 /usr/bin/denyhosts.py-2.6 --daemon -c /etc/denyhosts.conf
root     15413  0.0  0.0   8304   752 pts/1    S+   11:27   0:00 grep --colour=auto denyhost



any idea someone ??
by the way, all time, rc-status shows
Code:
denyhosts                                                                                                       [ stopped  ]

_________________
reup

"Don't wiggle the tail of the frog in the oil of the frying peanuts"
Back to top
View user's profile Send private message
reup
Guru
Guru


Joined: 13 May 2005
Posts: 419
Location: Nederland

PostPosted: Mon Jul 18, 2011 12:48 pm    Post subject: Reply with quote

solved, I found a bug very strange, the solution is very strange as well and not very distro like, but it worked for me :
https://bugs.gentoo.org/show_bug.cgi?id=286191 comment 74 explain to replace /usr/bin/denyhosts.py by /usr/bin/denyhosts.py-2.6
Code:
mv -f /usr/bin/denyhosts.py-2.6 /usr/bin/denyhosts.py


I backup-ed the original /usr/bin/denyhosts.py and did the mv

now denyhosts starts ok and works (tested)

I do not understand why during installation, one file is replace by another, maybe denyhosts does not work properly with baselayout 2 ? I checked the emerge logs from denyhosts, no warning as to change the files to make it works. it is not in the wiki as well

I edited the wiki : http://en.gentoo-wiki.com/wiki/DenyHosts
_________________
reup

"Don't wiggle the tail of the frog in the oil of the frying peanuts"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum