systemctl-default
Start system's default target
TLDR
Enter default mode as a blocking operation
Enter default mode as asynchronous operation
SYNOPSIS
systemctl get-defaultsystemctl set-default <target-name.target>
PARAMETERS
None specific (for systemctl get-default)
The systemctl get-default command does not take any specific options or arguments itself, beyond general systemctl options.<target-name.target> (for systemctl set-default)
Specifies the name of the target unit to which default.target should point. This must be a valid target unit file (e.g., graphical.target, multi-user.target, rescue.target).
DESCRIPTION
The term "systemctl-default" does not refer to a standalone Linux command. Instead, it typically refers to the concept of managing the default systemd target unit, which dictates the state of the system after boot. In systemd, boot states are defined by "targets" (similar to runlevels in older SysVinit systems). The default.target unit is a symbolic link, usually found at /etc/systemd/system/default.target, pointing to the actual target unit the system will attempt to reach during startup. Common targets include multi-user.target (for a console-only, networked system) and graphical.target (for a system with a graphical desktop environment).
The actual commands used to interact with this default target are: systemctl get-default: Displays the name of the current default target.systemctl set-default <target-name.target>: Changes the default target by updating the /etc/systemd/system/default.target symbolic link to point to the specified target. This change takes effect on the next reboot.
CAVEATS
It is crucial to understand that "systemctl-default" is not an executable command. Attempting to run it directly will result in a "command not found" error.
When using systemctl set-default, specifying an incorrect or non-existent target can render your system unbootable into a desired state, potentially dropping you into emergency.target or rescue.target. Always verify the target name and understand its implications before setting it as default. Modifying the default target should be done with caution.
<B>WHAT IS <CODE>DEFAULT.TARGET</CODE>?</B>
default.target is a special systemd target unit that serves as a symbolic link. It is the target that systemd attempts to activate by default during system startup. By changing where this symbolic link points, you can alter the system's initial boot state without directly modifying systemd's core configuration files.
<B>COMMON DEFAULT TARGETS</B>
multi-user.target: Configures the system for a multi-user environment with network services, but typically without a graphical interface. This is common for servers.graphical.target: Extendsmulti-user.targetby adding a graphical display manager and desktop environment. This is common for workstations and desktop systems.reboot.target: Causes the system to reboot.poweroff.target: Causes the system to power off.rescue.target: Provides a rescue shell, often used for system maintenance or repair.emergency.target: Provides an even more minimal shell environment, typically used whenrescue.targetis not accessible.
HISTORY
The concept of a default boot state is fundamental to operating systems. In Linux, before systemd, this was managed through runlevels in SysVinit. With the adoption of systemd as the default init system in most major Linux distributions (e.g., Fedora from 2011, RHEL/CentOS 7, Debian 8, Ubuntu 15.04), runlevels were largely superseded by "targets." The default.target was introduced as the primary mechanism for administrators to define the desired system state post-boot, providing a more descriptive and flexible approach compared to numerical runlevels.
SEE ALSO
systemctl(1), systemd.special(7), systemd.target(5), multi-user.target(5), graphical.target(5), rescue.target(5), emergency.target(5)


