In this video, we'll talk about masking services.
So what is this about?
Well, this is about units that cannot work simultaneously
on the same system.
Think about HTTPD and NGINX, for instance.
So if you want to make sure that HTTPD and NGINX can never
run on the same system, well, you
might think then just don't install them
on the same system, and you're totally right.
But in case they are present, you
can use mask on one of them.
And mask means that it can never be started, not even
by accident.
So system CTL mask links a unit to the dev null device.
And that's nothing, and that ensures
that it can never be started.
And if you want to get rid of your mask, use system CTL unmask.
Let me show you.
So using DNF install minus y NGINX.
And then system CTL status NGINX.service.
Now, obviously, NGINX and HTTP don't go well together,
and that is what I can ensure using system CTL
mask on NGINX.service.
And there you can see that it creates a symlink.
And the symlink is etc systemd system NGINX.service.
Now, this will always win above use ellipse systemd system.
And as you can see, this symlink
is linked to the null device.
So when I use system CTL start on NGINX.service,
this is what we get.
Unit NGINX.service is masked.
And if you wanted to be able to run it again,
use system CTL unmask.
Honestly, I don't want to do that
because I don't want to have HTTP and NGINX
on the same machine.