Adding a Service to Autostart (CentOS 6/7)
CentOS 6
To add a service to autostart, there is chkconfig service. By default, freshly installed CentOS distribution package includes many additional services.
The syntax of the service:
chkconfig --list service_name
chkconfig --add service_name
chkconfig --del service_name
chkconfig [--level levels] service_name <on|off|reset>
chkconfig [--level levels] service_name
You can see loadable services with the following command:
Check whether httpd is included in autostart:
Set performance level 3 and check:
Enable the service at all levels:
RedHat Linux distribution packages such as CentOS, Fedora includes SysV Init, which consists of 6 levels of system boot (runlevels).
0 — Halt
1 — Single-user text mode
2 — Not used (user-definable)
3 — Full multi-user text mode
4 — Not used (user-definable)
5 — Full multi-user graphical mode (with an X-based login screen)
It is recommended to enable services at the 3rd .
CentOS 7
To set a service to start on boot you can use systemctl:
To make sure a service does not start on boot:
You can check if a service is enabled or disable: