in reply to Re^3: Demonize Module, What are your thoughts?
in thread Demonize Module, What are your thoughts?

Thanks that anonymous sub makes sense.

What I'm trying to do with $SIG{__DIE__} is to run some code when the daemon dies to let me know it died. I just want to know if the daemon dies unexpectedly (perhaps Demonize isn't the best place to put this functionality).
  • Comment on Re^4: Demonize Module, What are your thoughts?

Replies are listed 'Best First'.
Re^5: Demonize Module, What are your thoughts?
by kyle (Abbot) on Dec 17, 2008 at 21:51 UTC

    The first thing to realize is that whatever you do won't be reliable. If you receive a signal that can't be caught, you won't have the chance to take any action about it.

    That said, $SIG{__DIE__} should work fine. Just be sure to check $^S before you do anything rash, and test your handler when it's done because I'm not really sure this does what you want.