Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

A daemon for incoming files

by tja_ariani (Acolyte)
on Oct 04, 2003 at 14:44 UTC ( [id://296514]=perlquestion: print w/replies, xml ) Need Help??

tja_ariani has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks,

I have a server here, running several processes, each process is compiled and run based on a configuration file. Currently I am trying to develop a daemon such that when I receive an update of the configuration file, I would be able to know that there is a new update coming, to stop the process, recompile and run it again.

The problem is, I do not know how should I tell the daemon that there is update for one of the process (how to detect the new file) . Do you have any idea on how to do this ?

Another problem is, how can I know which process to be stopped (the update belongs to which process) ?

Thank you for any suggestion of doing this.

Replies are listed 'Best First'.
Re: A daemon for incoming files
by perrin (Chancellor) on Oct 04, 2003 at 17:32 UTC
    You should look at how other systems do it. Apache writes its PID to a file, and when the shell script that controls it wants to tell it to re-read the config file, it just sends a HUP signal to the process listed in that PID file. Another approach is to make your daemons check the mod time of their config files once every minute or so to see if the have changed.
•Re: A daemon for incoming files
by merlyn (Sage) on Oct 04, 2003 at 15:15 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://296514]
Approved by jdtoronto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-26 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found