LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to tell a C++ programme to quit ? (http://www.linuxquestions.org/questions/programming-9/how-to-tell-a-c-programme-to-quit-361674/)

yogeshm02 09-09-2005 02:42 AM

How to tell a C++ programme to quit ?
 
Hi !
I have written a small C++ programme & am loading it through a init script. I'm using kill to signal it to quit. Is there any better method by which the programme could know this and save its important data.


With regards

bigearsbilly 09-09-2005 03:45 AM

man signal


http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+2

you can't stop the KILL signal.
Use TERM or HUP

addy86 09-09-2005 03:46 AM

You could send a less "devastating" signal to your program which can be cought. Have a look at man 1 kill and man 7 signal.

yogeshm02 09-09-2005 05:59 AM

Thanks for your reply.

I wanted a way for handling SIGTERM in my C++ prog. Now i know this after i downloaded "Advanced Unix Programming".

Thnaks again for your reply.


All times are GMT -5. The time now is 03:08 AM.