/etc/inittab,/etc/init.d/rcs and/etc/profile Analysis

Source: Internet
Author: User

After kernel mount the root file system, the first program to run is the LINUXRC under the root directory, which is actually a link to/bin/busybox, which means that the first program to run after the system is busybox itself.

BusyBox first resolves the/etc/inittab configuration file, which reads as follows:

# Boot-time System configuration/initialization script.
:: Sysinit:/etc/init.d/rcs			(RcS is a script that initializes the configuration and is executed first) # Example of how to put

a Getty on a serial line (for a terminal)
:: Respawn:/sbin/getty-l ttyS000 115200 VT100- n root-i "Auto login as Root ..."   (setting console properties) # Stuff to does when

restarting the init process
:: restart:/sbin/in It

# Stuff to do before rebooting
:: Ctrlaltdel:/sbin/reboot
:: Shutdown:/bin/umount-a-R
:: Shutdown :/sbin/swapoff-a

When you enter the console command line, the/etc/profile file is executed automatically, with the following contents:

Set environment variables (such as PATH, Ld_library_path),

Set Umask 0222 (the default permission for the created file is 644),

Set the color of the note and print "Welcom to Linux"


In short, execute/etc/inittab first, then call/etc/init.d/rcs, and finally execute/etc/profile

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.