/ Zope / Apsis / Pound Mailing List / Archive / 2004 / 2004-12 / test the configuration file

[ << ] [ >> ]

[ X-Forwarded-for missing / Michal ... ] [ Pound fails on Fedora Core1 / Garrison Hoffman ... ]

test the configuration file
Michal <michalg(at)gmail.com>
2004-12-15 23:10:26 [ SNIP ]
I'm looking through config.c, and imagine it would be pretty easy to
have a startup argument to pound which simply parses the configuration
file and prints any errors it detects, or returns 0 if there are none.
This would be extremely handy when a pound.cfg file is changed and
pound is about to be restarted -- before this happens, a check of the
pound.cfg file could abort the restart.

Has anyone written such a patch?

-Michal

RE: test the configuration file
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2004-12-16 09:31:51 [ SNIP ]
Now that would be *extremely* handy; we're often adding/removing
temporary backend hosts or changing the listened-for url string...

 John Snowdon - IT Support Specialist
-==========================================-
 School of Medical Education Development 
 Faculty of Medical Sciences Computing
 University of Newcastle

 Email : j.p.snowdon(at)ncl.ac.uk


>-----Original Message-----
>From: Michal [mailto:michalg(at)gmail.com] 
>Sent: 15 December 2004 22:10
>To: pound(at)apsis.ch
>Subject: test the configuration file
>
>
>I'm looking through config.c, and imagine it would be pretty easy to
>have a startup argument to pound which simply parses the configuration
>file and prints any errors it detects, or returns 0 if there are none.
>This would be extremely handy when a pound.cfg file is changed and
>pound is about to be restarted -- before this happens, a check of the
>pound.cfg file could abort the restart.
>
>Has anyone written such a patch?
>
>-Michal
>

Re: test the configuration file
Michal <michalg(at)gmail.com>
2004-12-16 15:27:59 [ SNIP ]
On Thu, 16 Dec 2004 08:31:51 -0000, John Snowdon
<J.P.Snowdon(at)newcastle.ac.uk> wrote:
> Now that would be *extremely* handy; we're often adding/removing
> temporary backend hosts or changing the listened-for url string...

I've made a simple workaround that isn't "correct" in my book, but works.

1. Modified the configure script to accept a --enable_check_config option
2. Modified pound.c to exit right after the config_parse() if
check_config is set.

Then I just configure with --enable_check_config and --without-log,
and rename the resulting binary to pound-check-config.

I'll try to find some time to "do it right" so there's a runtime flag
which does all this instead.

Another alternative to do, I imagine, is to copy your .cfg file to
another name, change its ListenHTTP parameter to a bogus port number,
and run pound on that new .cfg file. If everything passes, then things
should work with the correct ListenHTTP parameter. But that's still
too much playing around for a production environment IMHO.

-Michal

Re: test the configuration file
Robert Segall <roseg(at)apsis.ch>
2004-12-16 21:09:28 [ SNIP ]
On Wednesday 15 December 2004 23.10, Michal wrote:
> I'm looking through config.c, and imagine it would be pretty easy to
> have a startup argument to pound which simply parses the configuration
> file and prints any errors it detects, or returns 0 if there are none.
> This would be extremely handy when a pound.cfg file is changed and
> pound is about to be restarted -- before this happens, a check of the
> pound.cfg file could abort the restart.
>
> Has anyone written such a patch?
>
> -Michal

Thanks for a nice idea - this goes into the TODO list. Expect to see it in the 
next -current.
-- 
Robert Segall
Apsis GmbH
Postfach, Uetikon am See, CH-8707
Tel: +41-1-920 4904

MailBoxer