[Catalyst] Proper way to perform cleanups on server shutdown?

John Napiorkowski jjn1056 at yahoo.com
Wed Jun 27 22:38:34 GMT 2007


Hi,

I'm finding that the way I usually catch shutdown
signals to perform cleanup is not working.  Setting
%SIG handlers doesn't seem to do it and I'm not
finding that DESTROY methods are getting fired off in
the expected way.

For example if I set a $SIG{INT} handler in the
application class (MyApp.pm) that get's called if I am
running the development server foregrounded and the
interrupt it with a 'ctrl-c', but it doesn't get
called if the development server is deamonized and I
kill the process.  $SIG{QUIT} doesn't seem to do it. 
DESTROY doesn't seem to every get called.

So what I'm looking for is advice about the proper way
to shutdown the development server and Catalyst apps
running under Apache and how to trap those events both
globally (say in my MyAPP.pm module) and in
components.  I need this so I can do some
housekeeping, etc. 

Thanks!

--John


       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/



More information about the Catalyst mailing list