Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: you to make a demon in perl

by fsn (Friar)
on Oct 01, 2002 at 08:38 UTC ( #201947=note: print w/replies, xml ) Need Help??

in reply to how to make a demon in perl?

Just creating a script in /etc/rc.d/ somewhere is not enough. The runlevel startup script that calls the individual startup scripts, calls them in the foreground. So, if the startup script does not fork and exit, the bootprocess will hang forever.

Having the script fork itself, is one solution. Creating a startup script that calls your script in the background, with an '&', is another. There are probably a lot of simple startup scripts in your /etc/rc.d/* already, check them out. One note though: Linux, and RedHat in particular, uses a shell function 'daemon' instead of running the binary directly with an '&'.

Replies are listed 'Best First'.
Re: Re: you to make a demon in perl
by Sihal (Pilgrim) on Oct 01, 2002 at 11:49 UTC
    Nice I must admit that I wasn't aware of the risk of making the bootprocess hang... thanx all for your comments

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-12-05 21:37 GMT
Find Nodes?
    Voting Booth?

    No recent polls found