Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2005 10:13:54 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-hackers@freebsd.org, "roma.a.g" <roma.a.g@gmail.com>
Subject:   Re: easy question about kill command
Message-ID:  <200512160913.jBG9Dshc000450@lurza.secnetix.de>
In-Reply-To: <200512160846.jBG8kaEB099405@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Fromme <olli@lurza.secnetix.de> 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?
 > 
 > Because the kill command has no way to know about it.
 > 
 > The kill command only instructs the kernel to deliver
 > a signal to a process (or to a process group).  The only
 > feedback it gets from the kernel is whether the target
 > process exists or not.  (The latter is often used to
 > check for the existence of a particular process ID, by
 > trying to send it a "zero" signal which does nothing.)

Oh, I forgot to add one further fact:  The target process
can only respond to the signal the next time it gets a time
slice from the scheduler.  That doesn't necessarily need to
be immediately.  For example, when the process is currently
blocked (waiting for I/O or another resource), it can be a
long time until it gets a chance to respond to the signal.
At that time, the kill process has probably already exited.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"It combines all the worst aspects of C and Lisp:  a billion different
sublanguages in one monolithic executable.  It combines the power of C
with the readability of PostScript."
        -- Jamie Zawinski, when asked: "What's wrong with perl?"



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