Make Service Run at Startup – CentOS


This post was originally published in 2010
It may contain stale & outdated information. Or it may have grown more awesome with age, like the author.

Note to self: Stop forgetting this!

Make a service start at boot:

chkconfig httpd --add
chkconfig  httpd  on --level 235

Check if a service has been set this way:

chkconfig --list httpd

From Enabling and disabling services during start up in GNU/Linux.

What is that –level ### stuff?

ID Description
0   Halt
1   Single-User mode
2   Multi-user mode console logins only (without networking)
3   Multi-User mode, console logins only
4   Not used/User-definable
5   Multi-User mode, with display manager as well as console logins (X11)
6   Reboot

Thanks Wikipedia for the table!

Most users run X from one of two runlevels: 3 or 5. Runlevel 3 places your system in multi-user mode with full networking capabilities. The machine will boot to a text-based login prompt with all necessary preconfigured services started. Most servers are run in runlevel 3, as X is not necessary to provide any services utilized by most users. Runlevel 5 is similar to 3, except that it automatically starts X and provides a graphical login screen. Many workstation users prefer this method, because it never forces them to see a command prompt.

From The Official Red Hat Linux Reference Guide.

No comments | Trackback