in reply to daemon ... oop'ified?

I was not able to reproduce the problem you report. Can you give more explicit instructions to do this?

The following from perlipc may be of interest to you:

For example, to trap an interrupt signal, set up a handler like this:
sub catch_zap { my $signame = shift; $shucks++; die "Somebody sent me a SIG$signame"; } $SIG{INT} = ’catch_zap’; # could fail in modules $SIG{INT} = \&catch_zap; # best strategy
In other words, you may want to change your handler definitions to something like:
$SIG{'INT'} = \&sigint_catcher;

Can you elaborate on why you want to turn this into a class?

the lowliest monk

Replies are listed 'Best First'.
Re^2: daemon ... oop'ified?
by Zarathustra (Beadle) on Jun 17, 2005 at 08:50 UTC

    > was not able to reproduce the problem you report. Can you give more explicit instructions to do this?

    Sorry that I didn't think to include a debug mode before posting that... in order to see what I'm talking about, you need to tail/watch wherever you put local6 logs; or change the log facility from local6 to something else that you're already logging w/ your syslogger.

    > In other words, you may want to change your handler definitions to something like: >snip<

    Aha, I'll go and try that - thanks for reminding me about the perlipc perldoc!

    > Can you elaborate on why you want to turn this into a class?

    Well, it's part of a larger piece of software that I'm working on; an event processing engine - part of the functionality will be a master process that dynamically forks off other daemons... I thought having a real Class for this Daemonizer thing would be beneficial and cleaner and more powerful once I added some features.

    Thanks for your help!

Re^2: daemon ... oop'ified?
by Zarathustra (Beadle) on Jun 17, 2005 at 09:14 UTC

    >In other words, you may want to change your handler definitions to something like: $SIG{'INT'}  = \&sigint_catcher;

    Bingo - that was the ticket; thanks man!

    ( I've obviously got some re-conditioning ahead, in order to get my perl groove back on! heheh )

    As far as the OOP'ification goes -- I'll tweak around a little more so that I have some code that will show what I'm trying to get at; in order to help clarify my goals with this.

    Beers!