From: fork0@t-online.de (Alex Riesen)
To: Marco Costalba <mcostalba@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Easy shell question: how to make a script killing all his childs when killed?
Date: Sat, 9 Dec 2006 18:37:03 +0100 [thread overview]
Message-ID: <20061209173703.GA12373@steel.home> (raw)
In-Reply-To: <e5bfff550612090716p215167b9r2277b09c09b18894@mail.gmail.com>
Marco Costalba, Sat, Dec 09, 2006 16:16:32 +0100:
> So how can I write the script to be sure that when stopped, it will
> kill all his childern?
Strictly speaking: you can't. Anything you'd try will either be not
portable or involve quiet complex dependencies (like perl).
Are you sure you can't control each process independently?
Speaking not so strictly, you can use a script engine which supports
either signal handling or exit notification (i.e. sh has traps and
perl has %SIG and END{}). It's unsafe, ugly and not quiet portable to
that other operating system, but it often works and is (ab)used.
> P.S: I have no way to exec the script in fancy ways, I can just start
> it and get is PID.
Which is "fancy" enough. What do you mean "start"? Starting a new
process usually and notably involves forking and execing (even if the
first thing to exec will be your shell).
next prev parent reply other threads:[~2006-12-09 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-09 15:16 Easy shell question: how to make a script killing all his childs when killed? Marco Costalba
2006-12-09 17:37 ` Alex Riesen [this message]
2006-12-09 17:51 ` Marco Costalba
2006-12-09 21:39 ` Alex Riesen
2006-12-09 23:06 ` Marco Costalba
2006-12-10 14:25 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061209173703.GA12373@steel.home \
--to=fork0@t-online.de \
--cc=git@vger.kernel.org \
--cc=mcostalba@gmail.com \
--cc=raa.lkml@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).