LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] kill signals

[ILUG] kill signals

Niall O Broin niall at linux.ie
Fri Jan 11 10:17:33 GMT 2002


On Fri, Jan 11, 2002 at 09:35:10AM -0000, Adrian Flynn wrote:

> What is the correct kill signal to close a process and ALL its child
> processes cleanly? I am trying to stop and restart a shell script which
> pipes serial port data through several text procesing command. THere are 4
> processes in the process table for the script. When I kill -SIGINT, or
> kill -SIGTERM the shell processes, the other child processes remain running.
> Note it is important that all files are properly closed on termination so I
> cannot use SIGKILL.

If you used Perl you'd only have one process to kill :-) (and you'd have
some hope of doing the error checking I mentioned which is conspicuously
lacking in your shell pipe - or if you really don't care then leave error
checking out of the Perl script and use as is.) You could also add a
signal handler to the Perl script so that it trapped ^C and wrote out what
it still had in its buffer - be fun trying to get the shell pipe to do that.


Niall




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell