Date: Fri, 16 Dec 2005 10:36:34 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: "Roman Gorohov. " <roma.a.g@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: easy question about kill command Message-ID: <20051216163634.GD89708@dan.emsphone.com> In-Reply-To: <979057908.20051216120816@gmail.com> References: <14510301213.20051216105225@gmail.com> <200512160846.jBG8kaEB099405@lurza.secnetix.de> <979057908.20051216120816@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Dec 16), Roman Gorohov. said: > Oliver Fromme wrote: > > > roma.a.g <roma.a.g@gmail.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051216163634.GD89708>