Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10714

Re: Notifications when process is killed

References <CAKBHSgykQS0xC-2h_Z59wFHwzqh37+CasUnbGtzk5MZs_9KtqA@mail.gmail.com>
Date 2011-08-02 11:44 +0100
Subject Re: Notifications when process is killed
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1760.1312281844.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Aug 2, 2011 at 11:36 AM, Andrea Di Mario <anddimario@gmail.com> wrote:
> If i use SIGCHLD, i will have difficult when parent receive a SIGTERM, or not?

What you would do is create two processes. Set up your signal
handlers, then fork; in the parent, just watch for the child's death -
in the child, do all your work. When the parent receives SIGCHLD, it
can ascertain the cause of death.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Notifications when process is killed Chris Angelico <rosuav@gmail.com> - 2011-08-02 11:44 +0100

csiph-web