Ssh – Enable tty console login while “A stop job is running” (stop running forever, preventing shutdown)

consolelinuxshutdownsshsystemd

A message like this one is often shown on shutdown:

"A stop job is running ..." (nfs mount)

This apparently even happens when the NFS server did not go away. But even if the connection to the NFS server was lost, systemd is effectively preventing the system from shutting down. It is not possible anymore to ssh into the system and it's not possible to switch to another tty either. Hitting Ctrl + Alt + F2 does switch to a black screen with a cursor, but there's no login prompt. The user is forced to reboot the system forcefully, risking data corruption on those filesystems that are still mounted.

How can the tty console login be enabled at that time during the shutdown process?
It should be possible to log in as root and do umount -l or whatever might be necessary to allow the system to continue the shutdown process normally.

(This question is not about NFS, it's just a common example. An NFS mount does actually hang by design if the server went away. This question is about the fact that while this "stop job" is blocking the shutdown process, it is not possible to log in and enter commands to take care of the situation.)

Best Answer

do this ahead of time by issueing:

   systemctl enable debug-shell.service  # to activate F9-sh

go to Ctrl Alt-F9 debug root shell. maybe launch bash from sh there for convenience.

By actual shutdown time it is too late to still log in, however.

So to answer your question: It cannot.

Related Question