Article title: RHEL4-DNS automatic start control. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic classification RHEL4-DNS service (IV) if you want to enable automatic DNS startup control every time you start the system or restart the operating system, you want the DNS Service to automatically start. (I also fantasized about it when I started to use linux, but I firmly believe that my dream will become a reality), instead of starting the service manually every time. In linux, there is a control window similar to the graphic interface. you can enable this function by entering the ntsysv command, as shown in: windowsLiveWriter-429641856/supfiles000020ac/wps_clip_image-170000032.16.png "target = '\" _ blank \ "'>
You can see the figure: Use the cursor's up and down key to find the 'named' option, use the space key to select, then use the tab key to switch to the OK button, and press enter to complete. Isn't it easy? hurry up and try it! Some friends say that manual operations are still troublesome. how nice is the startup script! Well, that's good! There are some startup scripts in the/etc/rc. d Directory. let's take a look:
The rc. d folder contains some folders with numbers. the named folders correspond to different running levels of the system, and different running levels can start different services. This method is used in unix-like operating systems. We mainly use rc3.d (character interface) and rc5.d (graphic interface). That is to say, when we enter the system at the startup level of these two systems, the corresponding startup level service will be activated. In enterprises, Level 3 is generally used as the default startup level, that is, the directory rc3.d. Good! Next I will explain it with rc3.d as an example (others are the same). when talking about the folder rc3.d, let's take a look at what is in this folder! As shown in:
WindowsLiveWriter-429641856/supfiles000020ac/image00008).png "target = '\" _ blank \ "'> we can see from the figure that each file corresponds to every service in this system. In these files, there are many scripts whose names start with the uppercase letters K and S and are followed by the names in the/etc/rc. d/init. d Directory. S indicates that the service is started when it is started. the smaller the number, the more started it is. the script file name after the service is started indicates that the service is started. (Note: Here we will remind you that some services should be started in order. for example, DNS must be started after the NIC, that is, the network service. Otherwise, the server will encounter problems when it starts up, and the DNS and SMABA services do not need to be divided before and after ). Use the command ln? S/etc/rc. d/init. d/named/etc/rc. d/rc3.d/S55named: The number is determined by yourself. the generated file does not flash, indicating that the file is not incorrect. The service can be automatically started the next time you restart the server.
In upper case, K indicates the service to be shut down. The generation method is the same as the method for generating the startup file. here we will not repeat the description. The most important thing is to compile the service script file. most of the services that come with the system have written script files. some non-free services such as databases need to write scripts by themselves. (Note: You can view professional scripts to write books and materials .)