Inittab STARTUP configuration file maintenance skills

Source: Internet
Author: User
Article Title: Inittab STARTUP configuration file maintenance skills. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

I believe that the importance of the inittab configuration file does not need to be elaborated too much. This article introduces the precautions for maintaining the configuration file.

I. What should I do if the inittab file cannot be started after modification?

The content in the Inittab file is like the registry in the Microsoft operating system. If the changes made by the system administrator are inaccurate, the operating system may fail to start properly. In this case, does the system administrator have to reinstall the Linux operating system? In fact, you do not need to reinstall the inittab file to solve the problem of accidental and inaccurate modification. That is, the system administrator can enter the operating system in single-user mode at startup. Even if the inittab file is modified, you can log on to the operating system in single-user mode. Modify the file again until the modification is correct.

For example, if you use the GRUB boot Management Program (most Linux operating systems use this kind of boot Management Program), when the menu screen is displayed, press the key to enter the single-user mode. If you use the LILO boot Management Program, press Ctrl + X when the LILO boot menu screen is displayed. When you switch to the text mode LILO login screen, enter the inux s command. At this time, the system will automatically wait to the operating system in single-user mode.

However, some System Administrators cannot log on to the operating system in single-user mode. They do not know which content of the inittab file was changed after the last successful logon to the system. In order to restore this file smoothly in the future, I have two suggestions. First of all, when making changes to the inittab file, it is recommended that the content and cause of the modification be well-known at the beginning and place of the file. Poor memory. If the system cannot log on normally after modification, you can use the remarks to re-adjust the relevant parameters. Next, we recommend that you back up these configuration files before modifying them. In this case, even if you do not know where the file is changed, you only need to overwrite the file with the original backup content. Therefore, it is recommended that the system administrator back up the configuration file even if the configuration file is modified.

  2. switch between the text mode and the graphic window.

After the operating system is started, how can the system automatically log in? Linux and Windows have two options. That is, the system administrator can log on to the operating system in text mode when the operating system is started, or directly enter window management mode when it is started. The specific mode used during login is controlled by the inittab file. If you have a system administrator, you may not be familiar with operations in the text mode. Therefore, when installing a database software, you must first enter the graphical management interface. After the database is deployed and put into production, the system administrator wants the operating system to log on in text mode next time without enabling the graphical Management window. That is to say, after the operating system is restarted, it can be directly logged on in text mode. How to adjust the inittab file to meet this requirement.

Before talking about how to change this file, I would like to emphasize that we should first back up this file for emergency purposes. You can then open the configuration file by using any text editor provided by the operating system, such as vim. Then, a default startup configuration is found in this file. For example, id: 5: initdefault. This means that the system logs on to the graphical management interface by default. If the system administrator logs on to the user in text mode by default, you can modify the content of this line. The modification method is also very simple. You only need to change the content of this line to id: 3: initdefault. When the startup level is 3, the text mode is used. When the operating system restarts next time, it will directly enter the login screen in plain text mode. When you need to use a graphical interface next time, you can change this option back to 5. In text mode, run the startx command directly. However, they have different final effects. If you modify the inittab file, its effect is permanent. That is to say, if you change from 3 to 5, the next restart will log on to the graphical management interface. However, if you start the graphical Management window by running the startx command in text mode, it is only valid for the current painting. When the operating system restarts next time, the text management mode is still used by default. Users need to pay attention to this small difference. It should be noted that after the modification is completed, it is best to keep up with a note later. For example, at what time and for what reason a change was made. This is of great help to the later maintenance.

  3. Account prompt content in text mode.

After you enter the correct user name and password to log on to the operating system in text mode, the system displays the following prompt:

[Root @ aap root] #

What can this prompt tell us? First, we can know that the account currently used by the user is root (the first parameter from left to right ). Next, we can know that the host name is app. @ Indicates the host name. The last root represents the name of the directory where the current user is located. If a privileged user is logged on as the root user, the main directory allocated to the system is/root. If a common user is used, a user folder named after its username will be created under the/home directory when a user account is created. When you log on in text mode, the system automatically locates the user's home directory. The last prompt # is a symbol indicating the user identity. If the actual symbol is #, the account currently logged in is a privileged account. If $ is displayed, it indicates that the current account is a common user. In the doscommand window of the Windows operating system, the prompt does not convert with the conversion of user identity. This feature of the Linix operating system is very similar to that of Cisco and other network operating systems, and will change the prompt as the operating system's identity changes. This can give the system administrator a reminder to some extent.

[1] [2] Next page

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.