dangerous situation with shutdown process

Oliver Fromme olli at lurza.secnetix.de
Mon Jul 18 13:48:21 GMT 2005


Matthias Buelow <mkb at incubus.de> wrote:
 > Sorry folks, have I somehow dropped into a parallel universe,
 > or is there some serious misunderstanding going on?

Seems so.

 > To the OP: There is no "sync" process that is being killed by
 > shutdown

Yes, there is a kernel process called "syncer".  During
shutdown, each of the kernel processes (including the
syncer) has 60 seconds to terminate.  If it doesn't,
"timed out" is printed on the console.

This timeout can be changed using a sysctl tunable
(kern.shutdown.kproc_shutdown_wait).

 > The kernel writes out all dirty buffers as part of its
 > shutdown procedure.

When you shut down a machine, the kernel flushes all dirty
buffers to disk.  While it is doing that, it displays the
number of remaining buffers, with increasing time intervals
between them.  If there are still buffers left after a
certain number of intervals without change, the kernel
gives up.

If that is really the problem, then the best solution would
be to make the number of flushing intervals and/or the
increasing interval a sysctl tunable.  They're currently
hardcoded at 20 and 50ms, respectively; see the boot()
function in src/sys/kern/kern_shutdown.c.  That means
that the timeout will happen after 10 seconds.  Doubling
the number of intervals (i.e. 40 instead of 20) will make
the timeout happen after 40 seconds, which should be
sufficient.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co KG, Marktplatz 29, 85567 Grafing
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"C++ is the only current language making COBOL look good."
        -- Bertrand Meyer


More information about the freebsd-stable mailing list