linux_wiki:boot_systems_into_different_targets_manually

This is an old revision of the document!


Boot Systems Into Different Targets Manually

General Information

About this page/how-to/script.


Unit configuration file locations

  • /usr/lib/systemd/system ⇒ system unit configuration files (default with system)
  • /etc/systemd/system ⇒ additional configuration files (downloaded or custom)

Show available unit types

systemctl -t help

Some common targets

  • poweroff.target ⇒ power off the system
  • emergency.target ⇒ single user (root), read only root file system, do not mount other file systems, no network.
    • Used if the system cannot be repaired in rescue.target
  • rescue.target ⇒ single user environment (root), mount file systems read/write, with minimum services loaded. (no network)
  • multi-user.target ⇒ Multi-user non-graphical, with all file systems and networking
  • graphical.target ⇒ GUI environment, multi-user, with all file systems and networking
  • reboot.target ⇒ reboot the system

Current target

systemctl get-default

Set default to graphical target

systemctl set-default graphical.target

List loaded unit files (systemctl) of type target (–type=target) whether they are active or not (–all)

systemctl --type=target --all
  • systemctl list-units ⇒ “list-units” is the default command to systemctl if none specified
  • –type=target ⇒ show loaded, active units of the target type
  • –all ⇒ show all loaded unit files, even if they are not active

List all installed unit files on the system

systemctl list-unit-files

View a target's dependencies

systemctl list-dependencies multi-user.target
  • List what will start upon entering multi-user.target

Move from graphical target to multi-user (command prompt)

systemctl isolate multi-user.target
  • Stops all GUI services, goes to command line login prompt

Note:By default, systemctl commands will only show the active configuration files unless you pass the “–all” option

  • systemctl –type=service ⇒ list all loaded and active only service unit config files
  • systemctl –type=service –all ⇒ list all loaded and active or inactive units
  • systemctl is-active servicename ⇒ check if service is active or inactive
  • systemctl is-enabled servicename ⇒ check if service is enabled or disabled
  • systemctl –failed –type=service ⇒ list all failed services
  • systemctl list-unit-files –type=service ⇒ view enabled and disabled settings for all units installed on the OS of the service type

To boot to something other than the default target, such as the rescue target, during boot:

  1. Interrupt boot process at grub menu
  2. Press “e” to edit the boot entry
  3. Navigate to the “linux16” kernel entry
  4. Append “systemd.unit=rescue.target”
  5. Ctrl+x to continue boot process

  • linux_wiki/boot_systems_into_different_targets_manually.1456798999.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)