From man bootup
:
SYSTEM MANAGER SHUTDOWN
System shutdown with systemd also consists of various target units with some minimal ordering structure applied:
(conflicts with (conflicts with
all system all file system
services) mounts, swaps,
| cryptsetup/
| veritysetup
| devices, ...)
| |
v v
shutdown.target umount.target
| |
\_______ ______/
\ /
v
(various low-level
services)
|
v
final.target
|
_____________________________________/ \_________________________________
/ | | \
| | | |
v v v v
systemd-reboot.service systemd-poweroff.service systemd-halt.service systemd-kexec.service
| | | |
v v v v
reboot.target poweroff.target halt.target kexec.target
Commonly used system shutdown targets are emphasized.
Note that systemd-halt.service(8), systemd-reboot.service, systemd-poweroff.service and systemd-kexec.service will transition the system and server manager (PID 1) into the second phase of
system shutdown (implemented in the systemd-shutdown binary), which will unmount any remaining file systems, kill any remaining processes and release any other remaining resources, in a
simple and robust fashion, without taking any service or unit concept into account anymore. At that point, regular applications and resources are generally terminated and released already,
the second phase hence operates only as safety net for everything that couldn't be stopped or released for some reason during the primary, unit-based shutdown phase described above.
Which means reaching shutdown.target
isn't enough. Generally, poweroff.target
is the goal. Maybe something is preventing a umount()
? Once you boot back your system, you should check the system journal of your previous boot, especially towards the end : journalctl --system -b -1
Did you try waiting for some time, say, 5-15 minutes, to see if it doesn't ultimately power off ?
EDIT : To get and share the full journal of the previous boot :
- Type
journalctl --system -b -1
- Once it displays, I'm assuming the default
less
pager is used : type s
(lowercase), it will ask you for a filename to save the full journal in the current directory, type a name of your choosing and press enter
- Open the file with your preferred graphical text editor, mine is Emacs, but you may feel more comfortable with another one such as
gedit
- Select all text, copy, and paste where needed. This will probably be too big to paste in your question, hence my advice to paste to a service such as Pastebin
REEDIT : I should have noticed earlier that you mentioned you set a password for the root user. YOU'RE NOT SUPPOSED TO DO THIS. On Ubuntu, for security reasons, root shall not have a password, and you're supposed to reach root privilege through the sudo
command from an admin user session.
While I suppose setting a password for root should not be the cause of your problem per se, I can't say I'm sure about what would happen if you open a session as root... maybe there's some Ubuntu idiosyncrasy that will pose problems upon shutdown.