Systemd-analyze blame

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey Cyberians, welcome back to
00:00
the Linux plus course here at Cybrary.
00:00
I'm your instructor Rob Goelz,
00:00
and in today's lesson,
00:00
we're going to discuss systemd- analyze,
00:00
and the systemd-analyze blame command.
00:00
Upon completion of today's lesson,
00:00
you're going to be able to understand why we'd
00:00
want to use systemd-analyze,
00:00
and we'll use systemd-analyze to
00:00
troubleshoot systemd configuration,
00:00
and then we can use the information from
00:00
the systemd-analyze blame command
00:00
to determine what processes are loading slowly.
00:00
The systemd-analyze tool has
00:00
a lot of different features,
00:00
it's generally used to troubleshoot boot performance,
00:00
and to check the systemd initialization issues.
00:00
The only part of this that
00:00
a Linux plus exam mentions is systemd-analyze blame,
00:00
but there are other commands that you can use
00:00
as systemd-analyze that are
00:00
also helpful and good to know.
00:00
Let's talk about a few of these.
00:00
Well, the first one is systemd-analyze time,
00:00
and that's just really the default format
00:00
of systemd-analyze.
00:00
If you run it without any other options,
00:00
it's just going to display in this format,
00:00
and really what it does is it gives you
00:00
the initialization time for
00:00
the kernel and for user space.
00:00
Well, what does that mean?
00:00
The kernel is how long that
00:00
the system takes to boot up the kernel,
00:00
and then it delivers to user space
00:00
a login that you could use to log in,
00:00
or once it gets the user space,
00:00
anybody else in a multi-user system can log in and
00:00
use that system and run things on that Linux system.
00:00
Now, systemd-analyze critical chain is also
00:00
really helpful because it displays
00:00
all of the time critical units,
00:00
all the important things that
00:00
need to start up when the system starts up,
00:00
and it displays them in a tree format,
00:00
so we see that on this system,
00:00
the first thing starts with this graphical target,
00:00
multi user target,
00:00
then it runs a kernel loop service,
00:00
and it goes down in a tree-like format
00:00
and displays the amount of time
00:00
that it took for each one of
00:00
these critical units to start.
00:00
We'll see more about units later in this module.
00:00
Now, systemd-analyze dump displays
00:00
information about all systemd unit types,
00:00
not just the critical ones,
00:00
so that's something helpful to run as well,
00:00
and as systemd-analyze verify
00:00
scans unit files for configuration errors,
00:00
it displays any errors that it does
00:00
find in this configuration files,
00:00
and it requires that you give it
00:00
a unit file as an argument.
00:00
Like I said, we'll talk more about
00:00
unit files later, but in general,
00:00
unit files are used to configure how to
00:00
start something in systemd.
00:00
If this file is not configured properly,
00:00
you're not going to get too far,
00:00
things aren't going to start properly,
00:00
so you definitely want to run it through
00:00
this systemd-analyze verify if you're
00:00
having problems with the service or something starting,
00:00
to make sure that it actually is configured correctly.
00:00
Now that brings us to the star of the show,
00:00
the systemd-analyze blame command, and as I said,
00:00
the only systemd-analyze command that Linux
00:00
plus actually cares about is systemd-analyze blame,
00:00
and that's because it's important.
00:00
It's used to display the amount of time
00:00
that each unit took to initialize,
00:00
not just the critical ones,
00:00
and then we could use that information to find
00:00
units or processes that are starting slowly.
00:00
In other words, we're going to look and see what
00:00
is causing the system to boot up slowly,
00:00
and causing slow boot times in that system,
00:00
by running the systemd-analyze blame command.
00:00
But with that, we reached the end of this lesson,
00:00
and in this lesson, we covered
00:00
the systemd-analyze commands,
00:00
some of the other commands that we could use with it,
00:00
and we got into the systemd-analyze blame command,
00:00
which we can use to find slow booting processes.
00:00
Thanks so much for being here, and I look
00:00
forward to seeing you in the next lesson.
Up Next