Open lukebakare opened 10 months ago
For AL2023, I would recommend utilizing the systemctl isolate <desired_target>.target
to switch to the desired target.
# To list both active and inactive systemd targets
systemctl list-unit-files --type target --all
OR
systemctl list-units --type target --all
# To switch to desired target from CLI
# Note that you will lose network connectivity when running the follow command.
# Access via EC2 Serial Console.
systemctl isolate emergency.target
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctGive root password for maintenance
(or press Control-D to continue):
OR
# To switch to "rescue mode" target from CLI
systemctl isolate runlevel1.target
You are in rescue mode. After logging in, type "journalctl -xb" to view
system logs, "systemctlGive root password for maintenance
(or press Control-D to continue):
# After `systemctl isolate emergency.target` and login with root password
[root@i-0c2bbfd226ab10740 ~]#
[root@i-0c2bbfd226ab10740 ~]# who -r
run-level 2024-01-04 17:48
[root@i-0c2bbfd226ab10740 ~]# runlevel
N N
These commands do not work with the on premise vmware image, it stays at runlevel 5.
Describe the bug Entering single-user mode does not work and remains at level 5
To Reproduce Unlock the root account then enter rescue mode
sudo usermod -U root
sudo init 1
Expected behavior
who -r
should return run-level 1Output [root@al2023 ~]# who -r run-level 5 2023-11-28 18:17
Additional context When I attempt to enter single-user mode the output varies each time but will always have audit information:
[ 2659.572670] kauditd_printk_skb: 81 callbacks suppressed [ 2659.572688] audit: type=1305 audit(1701202140.362:181): op=set audit_pid=0 old=1643 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1