Masking a service
Now, let's say that you have a service that you never want to start, either manually or automatically. You can accomplish this by masking the service, like this:
[donnie@localhost ~]$ sudo systemctl mask httpd Created symlink /etc/systemd/system/httpd.service → /dev/null. [donnie@localhost ~]$
This time, instead of creating a symbolic link that points back to the service file, we've created one that points to the /dev/null
device. Let's try to start our masked Apache service to see what happens:
[donnie@localhost ~]$ sudo systemctl start httpd Failed to start httpd.service: Unit httpd.service is masked. [donnie@localhost ~]$
If you change your mind, just use the unmask
option.