Boot, reboot, shutdown using systemd Flashcards
Reboot in 5 minutes with messsage
Reboot at midnight
Reboot immediately
shutdown -r +5 System is going down for a reboot
shutdown -r 00:00
shutdown -r now
Shutdown
shutdown -P
systemctl poweroff
systemctl halt
shutdown -h +5 system will be shut down in 5 minutes
Cancel planned reboot
shutdown -c
Show running units with type=target
systemctl list-units -t target
Show the list of unit types
systemctl -t help
List dependencies
systemctl list-dependencies
systemctl list-dependencies multi-user.target
Main targets on the system
multi-user.target graphical.target rescue.target reboot.target emergency.target (A special target unit that starts an emergency shell on the main console. This target does not pull in any services or mounts. It is the most minimal version of starting the system in order to acquire an interactive shell; the only processes running are usually just the system manager (PID 1) and the shell process. )
Switch to another target
systemctl isolate multi-user.target
Get default target
Set default target
systemctl get-default
systemctl set-default graphical.target
Load into specified target while booting
press e to enter into grub menu
go to linux line and in the of the line append:
systemd.unit=multi-user.target
press Ctrl+x to continue the boot process
Recover lost root password
when rebooting press ‘e’ to enter grub menu
- add rd.break into the end of linux line
- ctrl-x -to continue booting into a single mode
- ls =>sysroot dir
- mount -o remount,rw /sysroot
- chroot /sysroot
- enter ‘passwd root’ to set up new root password
- touch /.autorelabel
- reboot -f