From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 16 16:36:38 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 B1CFD16A41F for ; Fri, 16 Dec 2005 16:36:38 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC4E243D5A for ; Fri, 16 Dec 2005 16:36:37 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id jBGGaYMu011180; Fri, 16 Dec 2005 10:36:34 -0600 (CST) (envelope-from dan) Date: Fri, 16 Dec 2005 10:36:34 -0600 From: Dan Nelson To: "Roman Gorohov. " Message-ID: <20051216163634.GD89708@dan.emsphone.com> References: <14510301213.20051216105225@gmail.com> <200512160846.jBG8kaEB099405@lurza.secnetix.de> <979057908.20051216120816@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <979057908.20051216120816@gmail.com> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 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 16:36:38 -0000 In the last episode (Dec 16), Roman Gorohov. said: > Oliver Fromme wrote: > > > 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? > > > There is no way for the kill command to know what the target > > process is going to do with the signal. This is entirely and only > > the business of the target process, which might chose to take the > > default action (in the case of SIGHUP it's to terminate the > > process), to ignore the signal alltogether, or to take some special > > action. Some programs use SIGHUP traditionally to rotate their > > logfiles, re-read configuration files, re-open network sockets, > > restart themselves, or other things. But that's entirely up to the > > program in question, and there is no way the kill command could > > know about it, let alone whether it was successful or not. > > Thanks for your reply. My question was about standard bsd daemons, > not about some apps with unpredictable behaviour. It still depends on what daemon you're talking about. syslogd, for example, re-reads /etc/syslog.conf and reloads its logfiles on SIGHUP. Luckily, most base daemons are started from their own /etc/rc.d/* scripts which know how that particular program works, so you can use them to start/stop/restart daemons and not have to look up pids manually. -- Dan Nelson dnelson@allantgroup.com