I have a homegrown framework which I use for my webapps (Perrin, it's
like the others, but faster!! and lighter!! and will be on CPAN any day
now... or something like that)

The framework does quite a lot of work setting up the applications that
depend on it, and one of the things it does is autoconfigures the
virtual hosts that the application requires.

The setup needs to be called from a PerlConfigHandler, otherwise it is
too late to set up the virtual hosts --> segfaults.

It optionally outputs a fair bit of information about what it has set
up, which goes to STDOUT.

The problem is this:

WHEN restart_count==1
 - you see all the setup information, but it sets everything up even
   when you use 'apachectl stop'
 - the setup gets dumped when apache restarts, so it doesn't work anyway

WHEN restart_count!=1
 - setup happens only when it should, but you don't see any of the
   startup info.
 - if I print the startup info to STDERR instead of STDOUT, then you
   don't see anything on 'apachectl start', but you do on 
   'apachectl restart'
 - 'apachectl -S'  gives no information about what virtual servers have
   been set up

SO, ideally, I would like to do this:
 - apachectl start : set it up twice, as it should be, so that it checks
   that apachectl graceful will work.  see the output once
 - apachectl restart : see the output once
 - apachectl stop : do not have it parse my setup

Any ideas how I could proceed with this? Should I be catching a
'SIGTERM' and turning off setup in that situation?

or is there just no way of detecting that this is a 'stop'?

The only other thing I've though of is doing something like:
apachectl -Dfast stop/start/restart

And if -Dfast is set, then only do the setup when restart_count!=1

many thanks

clint

________________________________________________________________________

Clinton Gormley [EMAIL PROTECTED]

www.TravelJury.com - For travellers, By travellers



Reply via email to