Bug#398739: Re: Bug#398739: attachment

2006-11-15 Thread martin f krafft
also sprach Yaroslav Halchenko [EMAIL PROTECTED] [2006.11.15.1512 +0100]:
 I believe that you mixed up interpolations (done but pythons config module) 
 and
 substitutions done by fail2ban
 
 actionstart = iptables -N fail2ban-name
   iptables -I fwchain -m state --state NEW -p protocol 
 --dport port -j fail2ban-name
   post_start_commands
 
 I don't think that it is fail2ban intent to substitute
 post_start_commands here -- try using interpolations %(...)s

I did. This gets me the error included below. Note how I am actually
passing post_start_commands as arguments to the action setting in my
jail.local file, just like it is being done for protocol and port.
Thus, I was assuming I was *not* mixing things up but rather did it
right. :)

lapse:~# /etc/init.d/fail2ban start  #[305]
Starting authentication failure monitor: fail2banTraceback (most recent call 
last):
  File /usr/bin/fail2ban-client, line 338, in ?
if client.start(sys.argv):
  File /usr/bin/fail2ban-client, line 316, in start
return self.__processCommand(args)
  File /usr/bin/fail2ban-client, line 185, in __processCommand
self.__readConfig()
  File /usr/bin/fail2ban-client, line 321, in __readConfig
self.__configurator.getAllOptions()
  File /usr/share/fail2ban/client/configurator.py, line 63, in getAllOptions
self.__jails.getOptions()
  File /usr/share/fail2ban/client/jailsreader.py, line 50, in getOptions
ret = jail.getOptions()
  File /usr/share/fail2ban/client/jailreader.py, line 87, in getOptions
action.getOptions(self.__opts)
  File /usr/share/fail2ban/client/actionreader.py, line 62, in getOptions
self.__opts = ConfigReader.getOptions(self, Definition, opts, pOpts)
  File /usr/share/fail2ban/client/configreader.py, line 81, in getOptions
v = self.get(sec, option[1])
  File /usr/lib/python2.4/ConfigParser.py, line 525, in get
return self._interpolate(section, option, value, d)
  File /usr/lib/python2.4/ConfigParser.py, line 593, in _interpolate
self._interpolate_some(option, L, rawval, section, vars, 1)
  File /usr/lib/python2.4/ConfigParser.py, line 624, in _interpolate_some
raise InterpolationMissingOptionError(
ConfigParser.InterpolationMissingOptionError: Bad value substitution:
  section: [Definition]
  option : actionstart
  key: post_start_commands
  rawval : 

.

-- 
 .''`.   martin f. krafft [EMAIL PROTECTED]
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems


signature.asc
Description: Digital signature (GPG/PGP)


Bug#398739: Re: Bug#398739: attachment

2006-11-15 Thread Yaroslav Halchenko
it is hard to see whole picture since you are just sending changing
snippets of configuration - send the whole entirety...

I bet that the reason for current issue is that  
you defined actionstart in [Definition] config/action.d/iptables.conf
whenever you defined in post_start_commands in [Init] --- how can it see
its value in Definition?? define it in new section [DEFAULT] of the same
file then... and you might need to define it to smth nonempty - I am not
sure what freaks ConfigParser out exactly

once again - this is not a fail2ban issue but rather logic behind usage
of python interpolations in config files

On Wed, 15 Nov 2006, martin f krafft wrote:

 also sprach Yaroslav Halchenko [EMAIL PROTECTED] [2006.11.15.1512 +0100]:
  I believe that you mixed up interpolations (done but pythons config module) 
  and
  substitutions done by fail2ban

  actionstart = iptables -N fail2ban-name
iptables -I fwchain -m state --state NEW -p protocol 
  --dport port -j fail2ban-name
post_start_commands

  I don't think that it is fail2ban intent to substitute
  post_start_commands here -- try using interpolations %(...)s
-- 
  .-.
=--   /v\  =
Keep in touch// \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko  /(   )\   ICQ#: 60653192
   Linux User^^-^^[17]




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]