Reboot on ssh command locks up device, how to solve?

Bo Berglund bo.berglund at gmail.com
Fri May 20 08:51:35 UTC 2022


On Thu, 19 May 2022 08:09:11 +0200, Bo Berglund <bo.berglund at gmail.com> wrote:

>On Wed, 18 May 2022 21:17:58 +0200, Bo Berglund <bo.berglund at gmail.com> wrote:
>
>>On Wed, 18 May 2022 19:33:39 +0100, Colin Law <clanlaw at gmail.com> wrote:
>>
>>>On Wed, 18 May 2022 at 18:28, Bo Berglund <bo.berglund at gmail.com> wrote:
>>>> ...
>>>> But I guess that finding this needle in the haystack is bwyond my capabilities,
>>>> so I will rely on the shelly plug for future mishaps too.
>>>
>>>Possibly there is a process that refuses to stop and hangs the reboot.
>>>Try it with -f and see if that does it.
>>>
>>>Colin
>>
>>I will have to wait until tomorrow morning (Sweden) to do that because the
>>system is busy until 07:00 CET
>>
>>But then I could presumably test by running a sudo reboot -f and if that works
>>then also test sudo reboot.
>>
>
>UPDATE:
>
>Now I stopped all running at jobs and then tried 'sudo reboot -f' from the PuTTY
>session.
>
>It worked as follows:
>
>- Cursor moved one line down and stayed there, no output
>- No keboard action worked anymore (expected)
>- A delay of some 10-15 seconds
>- Printed "rebooting" on screen (never seen that before)
>- Then the network disappeared and PuTTY showed the alert message
>- When I next connected with PuTTY after some 30 s it worked fine.
>
>In all other devices I have used the reboot command the PuTTY message about lost
>connection is instant, but here it takes a while for it to come.
>
>But unlike with only 'sudo reboot', adding -f seems to have the wanted effect of
>making a "clean" reboot.
>

As a follow-up I have now done the following:
- Connected to the unit using PuTTY
- Made sure there was no running at jobs
- Issued "sudo reboot", i.e. without the -f flag

Now there was an immediate loss of SSH connection, which is what I had expected
all along.
After some 30 s I again connected with PuTTY and it worked just fine!

So for some reason the system now behaves sensibly again.

Don't know what happened before, possibly there were a bunch of at jobs still
running or else a hung script or such. But I never suspected such a thing could
stop a reboot...

Noteworthy:
The system runs on a remote location where I have had connectivity problems on
the fiber so there may have been Internet connection loss some times while it
was running. If that would cause the reboot problem is over the top of me, but I
thought I would mention it.
A few days ago the fiber company got its act together and fixed the connectivity
problem. Now running at 250/250 Mbps.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list