[Openais] [PATCH] Use objdb

Patrick Caulfield pcaulfie at redhat.com
Tue Apr 11 01:41:19 PDT 2006


Hans Feldt wrote:
> Patrick Caulfield wrote:
>> Steven Dake wrote:
>>
>>> On Mon, 2006-04-10 at 20:37 +0100, Patrick Caulfield wrote:
>>
>>
>>>> How about making aisparser read its config filename from an
>>>> environment variable ?
>>>>
>>>
>>> yes this was the suggestion, although if no config environment variable
>>> is present the defaults will be used.
>>
>>
>> That's pretty easy :)
> 
> But from what I understand, you don't want the command line parser in
> main.c to set this env variable? You want it to be set externally to
> aisexec?
> 

Yes, that's why my patch reads it in aisparser.c. main.c has no business with
config file names. Just as an example, my Red Hat cman configurator reads it's
configuration from the cluster configuration daemon (ie over a socket), so the
config file name here is meaningless and would be ignored.

How about a compromise...main.c passes argv & argc to the configurator module
and it can do with them what it likes...That way the config file parser could
read a named config file if required.

It makes producing a sensible 'usage' message almost impossible though :-)

> I have played around with the following command line options:
> 
>> +       fprintf(stderr, "\nUsage: aisexec [options]\n\n"
>> +                       "Valid options:\n"
>> +                       "  -h\tthis help\n"
>> +                       "  -F\tForeground, do not daemonize (useful
>> for debugging)\n"
>> +                       "  -d\tEnable debug mode, produces a lot of
>> debug output\n"
>> +                       "  -c <config file>\n  \tconfiguration file,
>> default %s\n",
>> +                       config_file);
> 
> How about a more generic OPENAIS_CONFIG_FILE env variable set by the
> command line parser? It could be used by any config parser!
> 
> I really want the -c option on the command line and its kind of standard
> for all daemons to have this. See e.g. syslog-ng, xinetd, mountd, ...
> although it is named different things.
> 



-- 

patrick



More information about the Openais mailing list