BusyBox under etc directory file analysis

Source: Internet
Author: User

BusyBox under etc directory file analysisNovember 08, 2011 10:46:02 Dapeng 1987 read: 3016 Tags: permissionsshellcommentspathcommand more Personal Category: Arm/linuxCopyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. 6946822

(1)/etc/passwd the password file used to store the user's basic information. The password is composed of seven fields per line:

Username:passwd:uid:gid:comments:directory:shell

Username: User name, the name of the user login, such as root, of course, some of the user name is for positioning, for some directory or files to provide users. However, these users cannot log on, that is, pseudo-users, such as bin.

passwd: Password cipher text domain. If shadow, the password ciphertext is x, if the user name is valid but cannot log in, then is *; generally uses x, the pseudo-user of the position uses *.

UID: A number that the system uses to uniquely identify a user name. The UID is assigned as: 0, Superuser, 1~10, daemon and pseudo-user, 11~99, system reserved user, 100, normal user.

GID: Represents the default group number for the group to which the user is located, as determined by the/etc/group file.

Comments: Describes the user's personal information.

Directory: Defines the user's initial working directory.

Shell: A shell program that is enabled after a user logs on.

(2)/etc/group group account file, consisting of four domains:

Group name: Group password: Group ID: Group user

(3) resolv.conf network domain name resolution server (DNS) configuration file with the format name:

Server name IP address

(4)/etc/initatab init process initialization configuration file, the init process is the first process that runs after the system starts. Each line format is (excerpt from Baidu Encyclopedia):

Id:runlevel:action:process

ID: Specifies the TTY for the process being started. If it is empty, enable the system console.

Runlevel:busybox Ignore this field, you can leave it blank.

Process: Specifies the path to the process being executed, including command-line options.

Action: Specifies the type of action to apply to the process. There are several types of the following:

Sysinit Initialization Command script path for Init

Respawn is restarted whenever the corresponding process terminates;

Askfirst is similar to respawn, but the "pleas press Enter to activate this console" is displayed on reboot. The message waits for the user to press ENTER.

Wait tells Init to wait until the corresponding process finishes before continuing.

Once only executes the corresponding process once and does not wait for completion.

Ctrlaltdel the corresponding process is executed when the Ctrl+alt+del key combination is pressed.

Shutdown execute the appropriate process before shutting down the system.

Restart when Init restarts, the corresponding process is executed, usually the process executed here is the init itself.

(5)/etc/profile Shell Global configuration file, Shell startup, to configure the shell environment, usually put environment variables here configuration.

(6)/etc/fstab mount configuration file, which specifies the Mount block device and directory relationships. Each line of the file is in the format;

Fs_spec fs_file fs_type fs_options fs_dump fs_pass

Fs_spec This field defines the device or remote file system on which the file system you want to load is located (note that it is not a local file system).

Fs_file This field describes the directory point that you want the file system to load.

Fs_type defines the file system or local file system type on the device.

fs_options specifies that the file system that loads the device is a specific parameter option that needs to be used, and that multiple parameters are separated by commas. For most systems, "defaults" can be used to meet the needs. Other common options include the following:

Option meaning

RO load the file system in read-only mode

Sync does not buffer the write operation of the device, which prevents the file system from being corrupted when it is not properly shut down, but slows down the computer

User allows a normal user to load the file system

Quota forcing a disk quota limit on this file system

Noauto no longer uses the MOUNT-A command (such as when the system starts) to load the file system

Fs_dump This option is used by the "Dump" command to check how fast a file system should dump and set the field to 0 if no dump is required. File system frequency (Fs_freq), used by the dump program to determine which file system needs dump, if the last field is not set , the system considers its value to be 0, while the dump program considers the file system to be free of dump.

Fs_pass This field is used by the fsck command to determine the order in which the file system needs to be scanned at startup, the root filesystem "/" should have a value of 1 for the field, and the other filesystem should be 2. If the file system does not need to be scanned at startup, the field is set to 0. is used by the FSCK program to determine the system restart for the file system check the order, for the root system/This value should be set to 1, the other file system can be set to 2, in the same physical hard disk file system should be detected sequentially, and the different hard disk file system should be detected at the same time to take full advantage of the system parallelism. If the last field value is 0 or is not set, the FSCK program is loaded to skip detection of this file system.

(7)/etc/mdev.conf mdev configuration file, control the use of the device files and membership relationship. The format of each line is:

Device regex uid:gid octal permissions [=path] [@|$|*command]

or a

MAJ[,MIN1[-MIN2]] uid:gid octal permissions [=path] [@|$|*command]

For the second form, such as hd[a-z][0-9]* 0:3 660
In both of these forms, the contents of the brackets can be defaulted, and the manual pages of path in BusyBox are interpreted as

If you want to place the device node into a subdirectory, make sure the path has a trailing/. If you want to rename the device node, just place the name.
HDA 0:3 660 =drives/
This would move "HDA" into the drives/subdirectory.
HDB 0:3 660 =cdrom
This would rename "HDB" to "cdrom".

command for the command you want to execute, the previous symbol manual page is interpreted as:

@ Run After creating the device.
$ Run before removing the device.
* Run both after creating and before removing the device.

(8)/etc/shadow uses shadow encryption when storing relevant information.

(9)/etc/sysconfig the name displayed in the file system command prompt exists in the hostname file in that directory.

/ETC/RC.D store the script to run at startup.

(one)/ETC/INIT.D storage of the system boot-time configuration and self-initiated loading process, etc.

BusyBox under etc directory file analysis

Related Article

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.