Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: Re: Killing child process

by pg (Canon)
on Oct 12, 2003 at 17:02 UTC ( #298668=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Killing child process
in thread Killing child process

Two points about OS:
  • To send a signal to a process group, you have to be a super user;
  • Most of OS's, if not all, does not let you capture SIGTERM for ordinary users. That's for a good reason, if some processes (intentionally or by mistake - bugs) decide to be alive forever, that will really be a nightmare.

Replies are listed 'Best First'.
Re: Re: Re: Re: Killing child process
by sgifford (Prior) on Oct 12, 2003 at 17:42 UTC
    • This program doesn't work when run as root either.
    • I believe you're thinking of SIGKILL. SIGTERM is a perfectly normal signal. If I change the kill command to just send a normal signal to $kidpid, then the child process prints the TERM message, but not the grandchildren. Similarly, if you make the sleeps a little longer, you can send TERM signals by hand to individual grandchildren, and they print the message.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://298668]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2023-05-31 01:01 GMT
Find Nodes?
    Voting Booth?

    No recent polls found