Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2005 16:55:54 -0500
From:      Brian Reichert <reichert@numachi.com>
To:        "roma.a.g" <roma.a.g@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: easy question about kill command
Message-ID:  <20051216215554.GT19179@numachi.com>
In-Reply-To: <14510301213.20051216105225@gmail.com>
References:  <14510301213.20051216105225@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 16, 2005 at 10:52:25AM +0300, roma.a.g wrote:
> Is there anyone who can explain me, why when i say 'kill -HUP id', and its failed to restart, kill say nothing?

That's because all kill is responsible for is sending the signal;
see kill(2).

As to whether or not the process in question has a SIGHUP handler,
and what the behavior of that handler is, or what the latency in
said handler has in completing it's desired actions, is completely
outside the scope of the kill() syscall.

> It is such an easy to implement...

No, it's not: kill would need lots of knowledge about how every
possible program is supposed to work when sent a SIGHUP.

The apache_ctl script suppied by the Apache project is an example
of a control script that doesn't always work; said script thinks
that if it found a PID, and could send a HUP signal to it, it would
gleefully inform the user that apache has been stopped.

I've had to roll my own management script that more agressively
checks, and will not return until Apache indeed stops.  I needed
this in a situation where Apache, via mod_perl, had a bunch of
pending SQL transactions; asking apache to stop via a HUP could
take _minutes_ until all of those SQL connections tore down.

kill(2), and anything built on top of that, would have no idea if
the HUP signal was being processed at all...

> Roman Gorohov.                          mailto:roma.a.g@gmail.com

-- 
Brian Reichert				<reichert@numachi.com>
55 Crystal Ave. #286			Daytime number: (603) 434-6842
Derry NH 03038-1725 USA			BSD admin/developer at large	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051216215554.GT19179>