[CentOS] # chkconfig: kill at run level 3

Mon Dec 6 06:30:12 UTC 2010
Nico Kadel-Garcia <nkadel at gmail.com>

On Sun, Dec 5, 2010 at 10:46 PM, Michael D. Berger
<m_d_berger_1900 at yahoo.com> wrote:
> On Sun, 05 Dec 2010 10:50:53 -0500, Robert Spangler wrote:
>
>> On Friday 03 December 2010 19:30, Michael D. Berger wrote:
>>
> [...]
>>
>> Check /etc/rc.d/rc6.d and insure that you have K??yourscriptname in
>> there.  It looks like your script demon was setup to be run but was
>> never properly setup to be shut down.  When shutting down the system the
>> system is switched to run level 6.
>
> The correct K link does appear in /etc/rc.d/rc6.d .  I wrote a "stop"
> script that stops my daemon, does sleep 5, and then calls shutdown
> (or reboot).  I don't like this kluge, but it does work.  Could it
> be that my daemon stop procedure is too slow or complex for
> shutdown?  The TERM code does send stop messages to and join
> several threads, which in turn do the same to nested threads. Each
> thread does some stop logging, among other things.
>
> Mike.

"Taking too long" is unlikely. Running through the shutdown init
scripts is normally a serial operation, not a parallel one.

It could be that your shutdown script is simply incomplete, and fails
to *finish* stopping a process before proceeding to the next one. If
you wait on each threed to stop, surveying it for status and killing
it whan an ax only if necessary, then you may have a better fighting
chance of getting it shut down gracefully.

I've had some recent work with init scripts that weren't written as
init scripts, that get confused and hang ridiculously awaiting further
input. Issuing yet another "shutdown" or "reboot" command at that
point will simply re-run your shutdown procedures, especially this
shutdown script: that way can lie madness if your "threads" aren't
shut down gracefully.

It sounds like you need more thorough logging of what your shutdown
script does.....