Score:3

halt not emitting any logging/shutdown info, how to improve robust reporting or visual logging?

bd flag

I'm struggling with an Ubuntu system that is not doing anything visually following sudo halt. This is Ubuntu 20.04 and is running in on a macOS Parallels host system. I have four other Ubuntu instances on this particular system (one 18.04, two 20.04, and one 22.04) and they all halt in usual and expected ways that are not like the particular instance I'm asking about here.

Normally in such a server configuration I see a myriad of service status lines items, etc. telling me the status of the system and how it's shutting down various services and so forth.

In this case as soon as I do sudo halt (and enter the password) the screen simply goes black with nothing else showing up but a white underline cursor in the upper left. The computer stays on and does not shut down during this and the computer simply stays on indefinitely thereafter until I hold the power button in to kill it.

What can be done to isolate what may be going on here and to bring back detailed information to ensure proper shutdown is occurring AND to make sure it actually does shut off?

Score:3
cn flag

If you halt the OS, it (the OS) stops.

Some hardware (especially larger machines such as mainframes, let alone mini computers or super computers) having the machine shutdown creates power issues (in the building in which it's housed, especially on the same circuit given some devices can use tens-thousands of watts) with the sudden change of power in the circuit (not a problem on the micros/PCs most of us use as they only use a few hundred/thousand watts) thus the power off is a unwanted feature. GNU/Linux isn't just a PC OS don't forget; so power off in all cases is unwanted.

If you want the machine to power off, use the option that will poweroff with the halt (refer man halt) for your unstated OS/release.

bd flag
I've clarified the version of the specific question above for you. I do have a few dozen other installations of Ubuntu on various other hardware and systems (Linode, Proxmox, many other scenarios as well), but have limited this question as per your clear desire.
guiverc avatar
cn flag
You've not been very clear with the details you've added. Ubuntu LTS releases have multiple kernel stack options, and you've not given details as to what Ubuntu products (Server, Desktop) nor what kernel stack you're using on what works, and what isn't working. Nor if you tried giving the *poweroff* option of `halt` etc. It's possible a 18.04 or 22.04 system is using the same kernel as the 20.04, but you gave no clear specifics.
az flag
"Some hardware having the machine shutdown creates power issues with the sudden loss of power being used" - this is not very clear, could you please rephrase it? What "power issues"? Are you saying that issuing a shutdown command in an OS can foreseeably cause loss of power in the power grid the mainframe, mini computer or super computer connected to? What do you mean?
Margaret Bloom avatar
uz flag
If a capable user asks for a shutdown, the system should shut down. Your answer seems to imply that OP is wrong because they want to power off its own machine.
Score:1
co flag

On a normal Ubuntu system halt should resolve to /usr/sbin/halt (check with which halt), and that command should be a symlink to /bin/systemctl (ls -l /usr/sbin/halt).

If your setup differs from that, a possible cause is that there is another init system installed. With the full path of your halt command, you can find the responsible package with dpkg -S <path>.

The behavior you describe like halt behaves like the vintage halt command from before systemd.

bd flag
Thanks, yes, I agree and it does. Unfortunately `which halt` → `/usr/sbin/halt` and `/usr/sbin/halt` → `/bin/systemctl` so that's alright. Furthermoe `dpkg -S /bin/systemctl` → `systemd: /bin/systemctl` and `dpkg -S /usr/sbin/halt` gives "no path found...". Unfortunately even when I do a `tail -f /var/syslog&; sudo halt` it emits nothing whatsoever - goes straight to a black screen without the vm guest going off... so yeah, something is awry. I will add here, oddly, `sudo poweroff` does cause the vm guest to shut off entirely with a complete power off cycle such that Parallels detects it off.
bd flag
However even with the `sudo poweroff` "working," it unfortunately still does not give any system messages about services being terminated, etc. so it's just a strange straight to black screen + then window closing with vm situation.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.