- In this video, we are going to explore systemd targets.
So what's a target?
A target is a group of services.
Some targets are isolatable.
And that means that you can use them as a state
that your system should be started in.
There's four of them, emergency.target, and rescue.target,
both of which are for troubleshooting,
multi-user.target is a default state
that a non graphical server will start in,
and graphical.target is what you get
if you start a fully graphical environment.
You can use systemctl list-dependencies on a target to
see the contents and dependencies of a system target.
And you can use systemctl, get-default and set-default
to find out which is your default.target,
and to set your default.target.
Let's go check this out.
Okay, so I'm on my centos system and,
well, I could use systemctl get-default,
but honestly, if you see a graphical user interface
that shouldn't be necessary.
You see the graphical user interface
you are most likely in graphical.target.
You wanna know what is going on.
Well, systemctl list.dependencies is going to help you,
systemctl list.dependencies without any argument
is showing what you currently are in.
So, we can see that I'm in default.target.
In default.target. we have all of these that are started.
Now, default.target includes multi-user.target.
And in multi-user.target,
we have all of this stuff that has been started.
And oh, we seem to have an issue with kdump.service,
nice way of telling us that something is wrong.
And next we can see that the multi-user.target
itself includes the slice.target, the socket.target
the sysinit.target,
and so many more of these targets.
So, these are the targets
that are all in a state of isolatable.
Now I want to show you
systemctl list-units -t target,
which is showing only units that are of the type, target.
Now, what do we see?
We see, for instance
bluetooth.target, now, bluetooth.target
you can imagine these are all the services
that are required to initialize Bluetooth stack.
But Bluetooth is not a state that
you can boot your system into.
So that is kind of confusing.
Well, is it?
Well, I don't think so,
because really, in the end, there are only four
targets that you can put your system into.
And these are emergency, rescue, multi-user,
graphical target.
It's not much more difficult than that.
And the other targets, are just groups.
Groups that allow you to start one thing,
and with this one thing,
to initialize everything that is required,
in this case for Bluetooth support, for instance.