[CentOS] How to troubleshoot partial shutdown problem?

Wed Jan 2 07:47:48 UTC 2019
Simon Matter <simon.matter at invoca.ch>

> On Tue, 1 Jan 2019 12:47:42 +0100
> Marko Vojinovic <vvmarko at gmail.com> wrote:
>
>> after issuing a regular shutdown,
>> the system starts the shutdown procedure, but stalls at some point,
>> and never finishes. It gets to the console, writes the "powering down"
>> message and stops there --- the hardware never actually powers off.
>
> Just to add another datapoint --- when booted using the old kernel,
> 3.10.0-123, the shutdown proceeds correctly, while when booted using
> the latest kernel, 3.10.0-957.1.3, the shutdown fails. I don't have
> installed any other in-between kernels to test.

I had such problems but they were related to systemd.

We're happen to have NFS mounts on our hosts and when shutting down, the
network could be disabled before NFS was unmounted. The shutdown will then
hang. This happens not always but sometimes and it was very nice to debug.

The simple solution was to mount NFS with the option

x-systemd.requires=network-online.target

so that systemd knows it should unmount it before disabling the network.

Regards,
Simon