Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Writing a Perl Daemon

by sk (Curate)
on Jul 28, 2005 at 06:23 UTC ( #478844=note: print w/ replies, xml ) Need Help??

in reply to Writing a Perl Daemon


I had a similar issue (at least the checking if the script is already running) and they way i handled it is by creating a simple file (not necessarily locked). Every time the script starts it checks for .iamrunning file. If it exists then it just dies or exits without doing any processing or it creates one and starts the process.

If you want it to come back after system boot then you can put it as cron job or you can add it to your .cshrc/.bashrc or whatever you shell start up is.

regarding the kill - are you talking about Kill signals? Then you can use SIG INT to handle that part

If you are interested in locking i would do  perldoc -f flock

cheers SK

Comment on Re: Writing a Perl Daemon
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478844]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-02-13 11:10 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (427 votes), past polls