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

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
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

Adrian Flynn adrian.flynn at worldtravel.ie
Fri Jan 11 09:57:54 GMT 2002


I'm sorry, I'm a newbie at this kind of thing. How would I go about this
given the existing command line below?

The idea is that the process would be stopped and restarted by a cron job
each night.

Thanks

Adrian

-----Original Message-----
From: Hunt, Bryan [mailto:B.Hunt at emuse.ie]
Sent: 11 January 2002 09:41
To: 'adrian.flynn at worldtravel.ie'; ilug at linux.ie
Subject: RE: [ILUG] kill signals


you could get the pids of the child processes when you start them in a
sub-shell and then catch the signal using trap and then terminate the
sub-shell from your script. Perhaps this is a bit messy though.

B--

-----Original Message-----
From: Adrian Flynn [mailto:adrian.flynn at worldtravel.ie]
Sent: 11 January 2002 09:35
To: ilug at linux.ie
Subject: [ILUG] kill signals


Hi

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.

The command line is of the form:
cat /dev/ttyS0 |tr '\r' '\n' |csplit --digits=10 --prefix=~/`date
"+%Y-%m-%d-%H:%M:%S"`_ --elide-empty-files - /^L/ {*}

This, within a shell script, results in the following processes:
	bash
	cat
	tr
	csplit

If I SIGINT or SIGTERM the bash process, the others remain running

Many thanks in advance
Adrian

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.309 / Virus Database: 170 - Release Date: 17/12/2001



--
Irish Linux Users' Group: ilug at linux.ie
http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster at linux.ie

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.309 / Virus Database: 170 - Release Date: 17/12/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.309 / Virus Database: 170 - Release Date: 17/12/2001






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