Linux boot auto-start script

Source: Internet
Author: User

Through the site of the Tianjin IPTV demo Project commissioning, IPTV This system has a better understanding and understanding, because the IPTV itself needs to install a lot of services, and on-site implementation of these need to start the service of the script added to the boot automatically run, If the server restart after the need to manually open many services, work and later maintenance is relatively cumbersome, specifically summed up under the Linux boot automatic startup script involved in the knowledge and methods, as follows:


1, relevant basic knowledge points


1) The starting mode and execution order of Redhat are:


Load kernel


Executing the INIT program


/etc/rc.d/rc.sysinit # The first script executed by Init


/ETC/RC.D/RC $RUNLEVEL # $RUNLEVEL is the default operating mode


/etc/rc.d/rc.local #相应级别服务启动之后, execute the file (you can actually write the command you want to execute in the file)


/sbin/mingetty # Waiting for user to log in


In Redhat,/etc/rc.d/rc.sysinit primarily does the same initialization work in each of the operating modes, including:


Incoming Keymap and system fonts


Start swapping


Set host name


Setting up NIS domain names


Check (fsck) and Mount file system


Open Quota


Loading the sound card module


Setting the system clock


Wait a minute.


/ETC/RC.D/RC executes the script under the corresponding directory according to the run mode specified by its parameters (run level, which you can set in the Inittab file). Any kxx beginning with a stop is called by the call to the argument, and all the sxx begins with the start argument. The order of calls is performed by XX from small to large. (where xx is a number, which is the start order) For example, assuming the default run mode is 3,/ETC/RC.D/RC, the script under/etc/rc.d/rc3.d/is called as described above.


It is worth mentioning that the Redhat in the operating mode 2, 3, 5 are the/etc/rc.d/rc.local as the last of the initialization script, so users can add themselves in this file some need to be executed after the other initialization of the command before logging in.


When Init waits for/ETC/RC.D/RC to finish executing (because the action/ETC/RC.D/RC in/etc/inittab is wait), the/sbin/mingetty is run on the specified virtual terminal, waiting for the user to sign in.


At this point, Linux starts to end.

Linux boot auto-start script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.