Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Reliable killing children

by JaWi (Hermit)
on Aug 17, 2002 at 19:14 UTC ( #190905=perlquestion: print w/replies, xml ) Need Help??

JaWi has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monks,

I'm currently busy with a graphical front-end for smbclient, which allows me to click-and-download files from remote Samba hosts. Downloading is done simply by `back-ticking' a smbclient command.

It is possible to stop ongoing downloads by sending a HUP signal to the current process group (as stated in the PerlIPC manpage). This feature works fine until I spawn my graphical front-end from another Perl script! The kill-signal seems to be ignored and the smbclient program keeps running.

Is there a reliable way to make sure a script can kill all of his children even if the script itself is a child?

Thanks in advance!

-- JaWi

"A chicken is an egg's way of producing more eggs."

Replies are listed 'Best First'.
Re: Reliable killing children
by JaWi (Hermit) on Aug 21, 2002 at 15:01 UTC
    Fellow monks,

    I've seen the light! It also means I've to pay for my mistakes. My other question regarding the optimalization of Perl code has caused me to rewrite the above described problem. And guess what: it worked!

    I replaced the back-ticked commands with a `save exec' example as found in the PerlSec manpage and the ignored HUP problem magically disappeared...

    I love this language... *sob* ;-)

    -- JaWi

    "A chicken is an egg's way of producing more eggs."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://190905]
Approved by Courage
help
Chatterbox?
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: (2)
As of 2022-10-07 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (30 votes). Check out past polls.

    Notices?