Autostart applications in CentOS

Autostart applications in CentOS
In CentOS to add services (applications) in startup chkconfig service exists. Provided that these services are installed from the repository with the command yum.
To enable AutoStart, i.e. for an application to run at startup of the server (operating system), you must run the following command:
# chkconfig service_name on
However, the team did not use the chkconfig limited. For a start, check whether the startup server, for example, httpd:
# chkconfig-list httpd
httpd 0: off 1: off 2: on 3: on 4: on 5: on 6: off
And in response, we see several runlevels. For some, the httpd is enabled, for others not.
Runlevels in CentOS
Level 0stop system (halt) the system must cease;
Level 1single user mode-the system initializes the minimum services and gives you a single user (normally the superuser) without performing authentication command line. Generally, this mode is used to recover the system;
Level 2multiplayer modeusers can work at different terminals, logon authentication process;
Level 3-multiplayer network mode in contrast to the previous level, you configure the network and run various network services (primarily used in server systems)
Level 4 has no standard interpretation and is almost never used;
Level 5 graphics runcompared to the level 3 is also start x 11 graphics and login is in graphics mode;
Level 6 is reboot system when this mode stops all running programs and reboots.
To learn the current execution level enough to execute the command runlevel.
# runlevel
N 3
In my example, the server is at run level 3, which is the normal regime of its work.
Startup for specific Linux runlevels
By default, the command chkconfig prescribes services startup levels 2, 3, 4, 5. If you want to change this arrangement, then followed by the following options:
# chkconfiglevel 35 httpd on
Now the command chkconfig httpd daemon will add only 3 and 5 levels.
A short list of useful applications for chkconfig utility
Add to autostart
# chkconfigadd ServiceName
Check whether the service is enabled at startup
# chkconfig-list ServiceName
Enable the service at all levels (2, 3, 4, 5)
# chkconfig service_name on
Enable the service at certain levels
# chkconfiglevel 35 service_name on
Turn off the service at all levels (2, 3, 4, 5)
# chkconfig service_name off
Turn off the service at certain levels
# chkconfiglevel 35 service_name off
Remove a service from startup
# chkconfigdel ServiceName

Leave a Reply

Your email address will not be published. Required fields are marked *