Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-09-2005, 03:42 AM   #1
Registered: Jul 2004
Location: Chandigarh, India
Distribution: SuSe 10.1
Posts: 75

Rep: Reputation: 15
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
Old 09-09-2005, 04:45 AM   #2
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,371

Rep: Reputation: 192Reputation: 192
man signal

you can't stop the KILL signal.
Old 09-09-2005, 04:46 AM   #3
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
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.
Old 09-09-2005, 06:59 AM   #4
Registered: Jul 2004
Location: Chandigarh, India
Distribution: SuSe 10.1
Posts: 75

Original Poster
Rep: Reputation: 15
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems installing and executing programme, lwbeng Linux - Software 5 07-24-2005 09:25 PM
allow ssh then kill the programme master Linux - Security 4 02-06-2005 03:17 AM
Email Registration Programme sathu Programming 2 02-27-2004 06:19 AM
how to access ftp using c++ programme ? mphreddy Programming 1 10-28-2003 04:01 AM
how can I modify this programme? wwnn1 Programming 5 05-14-2002 08:55 AM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration