Managing systemd targets with systemctl
1 Environment #
This document applies to the following products and product versions:
SUSE Linux Enterprise Server 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
SUSE Linux Enterprise Server for SAP Applications 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
SUSE Linux Enterprise High Availability 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
SUSE Linux Enterprise High Performance Computing 15 SP5, 15 SP4, 15 SP3, 15 SP2
SUSE Linux Enterprise Desktop 15 SP5
SUSE Linux Enterprise Real Time 15 SP5
2 Managing systemd targets with systemctl #
systemctl
is the systemd
command for managing
target units. systemd
targets are different states that your system
can boot into, comparable to System V runlevels. Unlike SysV runlevels,
target units are named rather than numbered. For example, the
graphical.target
is comparable to SysV runlevel
5, multiuser with network and a graphical environment.
Complex targets, such as graphical.target
, are meta
targets made by combining a subset of other targets. You may create custom
targets by combining existing targets, and modifying individual targets as
needed.
There are over 80 targets listed in man 7 systemd.special
. The next section
(Section 3, “List of the most important targets”) lists the most
important targets.
3 List of the most important targets #
default.target
The target that is booted by default. This is a symbolic link to another target, like
graphical.target
. This can be changed permanently via YaST (see xref linkend="sec-boot-runlevel-edit"). To change it for a session, rather than permanently, use the kernel parametersystemd.unit=TARGET-NAME.target
at the boot prompt.emergency.target
Starts an emergency shell on the console. Find it in your GRUB 2 menu, or enter it at the boot prompt as
systemd.unit=emergency.target
.graphical.target
Starts a system with network, multiuser support, and a display manager.
halt.target
Shuts down the system.
multi-user.target
Starts a multiuser system with networking, and no graphical environment.
reboot.target
Reboots the system.
rescue.target
Starts a single-user system without networking.
To remain compatible with the System V init runlevel system, systemd
provides special
targets named runlevelX.target
,
mapped to the corresponding SysV runlevels numbered X.
To see the current target, use the command systemctl get-default
.
systemd
target units #
System V runlevel |
|
Purpose |
---|---|---|
0 |
|
System shutdown |
1, S |
|
Single-user mode |
2 |
|
Local multiuser without remote network |
3 |
|
Full multiuser with network |
4 |
|
Unused/User-defined |
5 |
|
Full multiuser with network and display manager |
6 |
|
System reboot |
systemd
ignores /etc/inittab
The runlevels in a System V init system are configured in /etc/inittab
. systemd
does not use this configuration.
4 Commands to change targets #
Use the following commands to changegit target units:
Task |
|
System V init Command |
---|---|---|
Change the current target/runlevel |
|
|
Change to the default target/runlevel |
|
n/a |
Get the current target/runlevel |
With |
or
|
persistently change the default runlevel |
Use the Services Manager or run the following command:
|
Use the Services Manager or change the line
in |
Change the default runlevel for the current boot process |
Enter the following option at the boot prompt
|
Enter the desired runlevel number at the boot prompt. |
Show a target's/runlevel's dependencies |
“Requires” lists the hard dependencies (the ones that must be resolved), whereas “Wants” lists the soft dependencies (the ones that get resolved if possible). |
n/a |