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


Groups > comp.lang.python > #10713

Notifications when process is killed

Date 2011-08-02 12:36 +0200
Subject Notifications when process is killed
From Andrea Di Mario <anddimario@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1759.1312281407.1164.python-list@python.org> (permalink)

Show all headers | View raw


> You won't be able to catch SIGTERM, as Thomas said, but if you need to
> know what caused a process to end, the best way is to have code in the
> parent process to catch SIGCHLD. When the child ends, for any reason,
> its parent is sent SIGCHLD with some parameters, including the signal
> number that caused the termination; you can then log anything you
> want.

Hi, i understand, i've read that SIGKILL can't catch, but nothing
about SIGTERM.
If i use SIGCHLD, i will have difficult when parent receive a SIGTERM, or not?

Thanks, regards.

--
Andrea Di Mario

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


Thread

Notifications when process is killed Andrea Di Mario <anddimario@gmail.com> - 2011-08-02 12:36 +0200

csiph-web