Could you assist me to solve an issue?
I\m using Rocky Linux 9.2 istalled in VMWare Workstation 17. When I try to reboot system using command systemctl isolate reboot.target I get an error:
But when I try to reboot system with reboot command it works fine
Could you help me to understand why I can’t reboot system with systemctl isolate?
Thank’s a lot in advance!
You’ve not provided enough information such as screenshots that detail the error you are receiving.
Below is configuration file of network interface
I believe the correct command for systemctl to reboot is:
in fact I just did this on two of my Rocky machines, both 8 and 9. As for isolate command, I believe you normally use that to change between different runlevels, like you used to use
runlevel 3 or
runlevel 5 to go from console to graphical. Using the commands to list targets:
[root@rocky8 ~]# systemctl --type=target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cryptsetup.target loaded active active Local Encrypted Volumes
getty.target loaded active active Login Prompts
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Network (Pre)
network.target loaded active active Network
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
sshd-keygen.target loaded active active sshd-keygen.target
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
timers.target loaded active active Timers
doesn’t show reboot.target, although that can be found on the system. It could well be that reboot.target isn’t supposed to be used in that way, and is why it doesn’t work. To be honest, it’s easier and quicker to just type
reboot, or even
shutdown -r now. Even
systemctl reboot is shorter than using the isolate command.
A snippet from the systemctl man page, under “isolate UNIT” (emphasis added):
This command is dangerous, since it will immediately stop processes that are not enabled in the new target, possibly including the graphical environment or terminal you are currently using.
This sounds exactly like what you’re observing after using it to reboot the system.
I’ve no idea why you would not simply run the reboot command instead, especially as you’ve confirmed that it does, indeed, work in comparison? Is there something specific you are trying to accomplish via a script etc. ?
Many thanks to all for answers. My question is no more than curiosity. In Debian this command works fine, so I was intrested why behaviour differs in Rocky Linux.
Topic can be closed.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.