LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   reading pid from pid file in C language (https://www.linuxquestions.org/questions/programming-9/reading-pid-from-pid-file-in-c-language-642138/)

shifter 05-14-2008 09:51 AM

reading pid from pid file in C language
 
Hi all, I would read a process id from a pid file in C language.
For instance, I have a daemon with your pid in daemon.pid file
How can I kill above daemon reading pid from pid file?

thanks,
savio

SciYro 05-14-2008 10:49 AM

Send a signal to the process (by reading its PID from the PID file) asking it to terminate. Read the GNU C library documentation under signals for how to do this, and the appropriate signal to send (note: do not use signal 9, sigkill, its a very rude signal to use).


All times are GMT -5. The time now is 05:15 AM.