On Sun, Sep 20, 2015 at 8:10 PM, Quartz <[email protected]> wrote:
>>>> "time sh /etc/rc shutdown". See what's still running. kill -HUP
>>>> everything
>>>>>
>>>>> except init and your session and see what's still running 5 seconds
>>>>> later.
>>
>>
>> Hmm, you truncated the suggested steps...
>
>
> You wrote:
>
> "Hmm?   How about replicate the process and observe the results?  "time
> sh /etc/rc shutdown".  See what's still running.  kill -HUP everything
> except init and your session and see what's still running 5 seconds
> later.  Then again with kill -TERM.  Whatever still standing is
> slowing you down; for each one figure out whether and when it should
> have died."
>
> I took that to mean:
>
> 1) run (presumably as root) 'time sh /etc/rc shutdown'
> 2) check 'ps -aux' to see what's still running
> 3) 'kill -HUP [PID]' for each of the remaining processes
> 4) check 'ps -aux' again
> 5) 'kill -TERM [PID]' for each of the remaining processes
> 6) check 'ps -aux' again

Yes.  Perhaps it isn't clear that I would *expect* stuff to still be
running at step 4, and thus for shutdown like this to take at least 5
seconds.

You said shutdown was taking "a solid 10 seconds", so I was under the
belief that some process was hanging around *past* step 6, and
requiring a SIGKILL to be taken down, but I guess we don't have the
data to conclude that.


> I appear to be hung up near the beginning. 'sh /etc/rc shutdown' doesn't
> appear to do anything, since it returns instantly and the ps output from (2)
> is identical to ps output from before 'sh /etc/rc shutdown'. (3) "doesn't
> work" in the sense that it doesn't appear to actually stop [m]any services
> (presumably because I didn't do something correctly before this point).

It sounds like things are behaving as expected for steps 1-4: shut
down packaged services (none, or they're quick), then shut down
interactive sessions, giving them 5 seconds to do so.

If the next step, the one you didn't describe the results of, killing
daemons with SIGTERM, leaves services running then there may be a bug
in those programs worth fixing.  Or maybe everything dies after the
SIGTERM and it's the kernel's shut down work, flushing stuff to disk
and such that is rounding out the 10 seconds.


Philip Guenther

Reply via email to