-   Programming (
-   -   Sending a signal to a process (Help me) (

rajesh_b 09-17-2004 12:36 AM

Sending a signal to a process (Help me)

I am intemediate linux programmer. In the part of one program, i have to send a signal notifiication to the parent process. The program is a daemon service, which reads the xml configuration file and transfers the file from one directory to another directory. These two directories are mentioned in the xml file. What is my problem is " the daemon must be restarted if this xml configuration file is changed/saved. And i know this can be done throug signal handling. How can i send the daemon process a signal when the xml file is modified "

Plz help me.
Thankx is advance.


infamous41md 09-17-2004 01:30 AM

is the problem that you don't know how to send a signal? (man kill)
or is the problem that you aren't sure how to know when the file was last modified? (man fcntl and check out part about async i/o signals).

potetgull 09-17-2004 01:30 AM

from a shell it can be done as kill -signal_name <pid> or kill -signal_name <pid>

Some of the more commonly used signals:

1 HUP (hang up)
2 INT (interrupt)
3 QUIT (quit)
6 ABRT (abort)
9 KILL (non-catchable, non-ignorable kill)
14 ALRM (alarm clock)
15 TERM (software termination signal)

and -1 or -HUP usely nowadays mean *re-read your config file*

(shamelessly riped from the openbsd manual)

All times are GMT -5. The time now is 07:14 PM.