Hello, and welcome to this presentation from Pluralsight.
My name is Andrew Mallet,
and I'm here as your instructor to help guide you through the module,
Managing Linux Services.
As we work our way through this module,
we're going to be taking a look at both Linux services and process management.
So that's going to include systemd, our process ID 1.
With this, we can look at the systemctl command used to manage our services,
but also, there's a whole ecosystem behind systemd,
and that's going to include commands such as our timedatectl,
localectl, and hostnamectl, giving us one set of commands that we can use,
irrespective of the Linux distribution that we're using.
These all used to be a completely different set of commands,
depending on the Linux flavor you were using.
Now, with systemd, we manage everything with one set of command‑line tools.
When we look at our services, we can take a look at the chrony service,
setting up a time server so we can go through and
synchronize and have accurate time on our system.
However, systemd can also manage this with the systemd and timesync service.
We can take a look at the cron job scheduler,
so we can schedule tasks when we want them to happen,
such as backups and things like this.
But also,
this can be covered through systemd timer units that we will take a
look at. As far as process management is concerned,
we going to be taking a look at our commands ps,
to show our process status, we can search for processes using pgrep,
and we can send signals to processes using pkill.
We can also look at setting the scheduling priority
using the nice and renice commands.
We'll also be taking a look at the top command,
and with the top command, we get a great overview of how busy our system is.
So hopefully, this is giving you a good flavor of what's going to come,
and you're ready to dive into our first element,
where we're looking at process ID 1, systemd,
the unifier that allows us to use different Linux distributions without
having to learn completely different sets of commands.
So the idea is for process ID 1 that we start our boot loader,
so it's going to be GRUB in many instances.
Our boot loader will load the kernel,
and the kernel will go through and start systemd process ID 1,
and systemd then manages the rest of our services.
To manage our services, we use the systemctl command,
and again, part of our really great unifying between different distributions.
I don't have to worry about different sets of commands between
Debian‑based systems and Red Hat‑based systems.
When we look at the status of our service,
we can get a lot more information than we ever
would with our old service command.
We can go through and both enable a service and start it using enable ‑‑now.
And in the same way, we can both stop our service and
disable it with the disable ‑‑now.
We can also go through and take a look at our scripts without knowing where
they are, and we can even go through and edit the scripts with the
systemctl command. Taking this a little bit further,
we can actually go through and analyze the boot time. So we've got the
systemd‑analyze will show how long the boot took,
but we can also go through, and perhaps this is a little bit unkindly named,
but the blame option will go through and show which
services took the longest to boot.
And as far as the ecosystem is concerned,
giving us this real uniformity across all of our Linux distributions,
we can set things like our hostname,
we can set our time zone, and we can go through and set our
locale information without having to worry about how it's
done on a particular distribution.
So this is what systemd is all about, uniformity,
and we're going to see it in action now as we start using some of these commands.