Perhaps I'm missing something, but what's the problem with doing something 
like:

package MyApp;

$SIG{INT} = sub {
  graceful_shutdown();
  exit(1);
}

END { graceful_shutdown() }

sub graceful_shutdown {
  # Code here...
}

Note that a $SIG{INT} will not exit if you override it, which is why you need 
the exit. This means that you could make it restart on a SIG{INT} (or perhaps 
better, $SIG{HUP})

Mark

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to