From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 16 21:56:03 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 688F916A420 for ; Fri, 16 Dec 2005 21:56:03 +0000 (GMT) (envelope-from reichert@numachi.com) Received: from meisai.numachi.com (meisai.numachi.com [198.175.254.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 58A6343D77 for ; Fri, 16 Dec 2005 21:55:57 +0000 (GMT) (envelope-from reichert@numachi.com) Received: (qmail 79000 invoked from network); 16 Dec 2005 21:55:55 -0000 Received: from natto.numachi.com (198.175.254.216) by meisai.numachi.com with SMTP; 16 Dec 2005 21:55:55 -0000 Received: (qmail 30916 invoked by uid 1001); 16 Dec 2005 21:55:54 -0000 Date: Fri, 16 Dec 2005 16:55:54 -0500 From: Brian Reichert To: "roma.a.g" Message-ID: <20051216215554.GT19179@numachi.com> References: <14510301213.20051216105225@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14510301213.20051216105225@gmail.com> User-Agent: Mutt/1.5.10i Cc: freebsd-hackers@freebsd.org Subject: Re: easy question about kill command X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 21:56:03 -0000 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 55 Crystal Ave. #286 Daytime number: (603) 434-6842 Derry NH 03038-1725 USA BSD admin/developer at large