Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Writing a Perl Daemon

by Zaxo (Archbishop)
on Jul 28, 2005 at 06:48 UTC ( #478848=note: print w/replies, xml ) Need Help??

in reply to Writing a Perl Daemon

A) Super Search for daemon will find some nodes on writing perpetual "background" processes. There are some fiddly bits to look after, but Proc::Daemon will do a fine job of that for you.

B) A convenient way of using a lockfile is with sysopen;

sysopen my $fh, '/var/lock/mydaemon', O_EXCL | O_RDWR or die "$0 is already running";
You should ensure that you call unlink '/var/lock/mydaemon'; in every exit path your code may take.

After Compline,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478848]
[Eily]: does this mean you'll give up the random prefix solution LanX?
[LanX]: yep, sorry ;(
[Eily]: such a fine and clever workaround though...
[LanX]: well even my random fingers have memory ...
[Eily]: you could have tried randomly swapping your fingers
[Eily]: enigma style
[choroba]: so it was you who typed the whole phrases?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2017-03-28 13:04 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (331 votes). Check out past polls.