3.7.5 Enabling and Disabling Services

You can use the systemctl command to enable or disable a service from starting when the system starts, for example:

# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' \

The command enables a service by creating a symbolic link for the lowest-level system-state target at which the service should start. In the example, the command creates the symbolic link httpd.service for the multi-user target.

Disabling a service removes the symbolic link:

# systemctl disable httpd
rm '/etc/systemd/system/multi-user.target.wants/httpd.service'

You can use the is-enabled subcommand to check whether a service is enabled:

# systemctl is-enabled httpd
# systemctl is-enabled nfs

For more information, see the systemctl(1) manual page.