|
|||
|
|||
|
Starting Linux Services At Boot In this article I'll take a quick look at the topic of starting services / daemons at boot. By no means is this a end all tutorial but rather a quick guide to get you pointed in the right direction. Linux boots services using a chain of scripts. You can find these scripts in the /etc/init.d directory. In addition to these scripts is a system of run levels. Each run level determines which scripts run (More on this later). You can find which run level your system boots into by default in the /etc/inittab file, the line will look something like below. id:3:initdefault:You will notice above that the run level is set to 3 which is usually a non-graphical mode, where run level 5 is graphical (Starts X11). How the system works is there is a bunch of symbolic links in folder name /etc/rcX.d (the X is replace with the run level number, so run level 3 would be rc3.d) pointing to each script that needs to run at boot. Each of these links will be prefixed with a S for start or K for kill, so for each service you have two links one for both booting and another for shutting down. In addition you will also see a number prefixed, which controls the start or stop order. The higher the number the later the service stops or starts, and the lower the number the sooner it starts or stops. I do not recommend you manually edit this folder or the links but It good to know how this works when using the command line utility to edit this folder. Controlling Service Start / StopTo control your services you may need to first list what is starting or not starting. To see this you can type: # /sbin/chkconfig --listTo turn on or off a specific service at a specific run level (see above for explanation of this) type something like below (For this example I am turning on the httpd service at run level 3): # /sbin/chkconfig --level 3 httpd on
Other ImprovedSource Articles: |
|||
ImprovedSource. Copyright 2007
+ Contact Us + Home
+ Search
+ RSS Feed |
|||