Linux administrator Manual (1)-System Overview

Source: Internet
Author: User

This chapter provides an overview of Linux. First, describe the main services provided by the operating system. Then describeProgramWith a considerable lack of detail. This chapter aims to understand the system as a whole and further details each part.

Different parts of an operating system

A Unix operating system includes a core program kernel and some system programs. There are also some applications that do something: application programs. The core is the heart of the operating system. It tracks files on the disk, starts programs and runs them, allocates memory and other resources to different processes, receives and sends packets to and from the network, and so on. The core rarely works on its own, but it provides tools that can be used to build all services. It also prevents anyone from directly accessing the hardware and forces everyone to use the tools it provides. In this way, the core provides protection between each user and other users. The tool provided by the core is used by calling system CILS through the system. To learn more about this, refer to the second part of the manual page.

System programs use the tools provided by the core to implement different services required by the operating system. System programs and all other programs run on the core, called the user mode. The difference between a system program and an application is the purpose: the application intends to do some useful work (or game), while a system program is required for system work. The word processor is an application, and telnet is a system program. The difference is often vague, maybe, just to force classification.

AlthoughProgramming LanguageIt does not have to be a part of the operating system. The operating system can also include the compiler and its related libraries (GCC and C libraries in Linux ). Documents, and sometimes even games can be part of the operating system. Traditionally, the operating system is defined as the content on the installation tape or disk. It is not clear about Linux because it is distributed on FTP sites around the world.

Key components

Linux core includes several important parts: process management, memory management, hardware device driver, file system driver, network management and other different parts. Figure 2.1 shows some of them.

Memory Management and process management are the most important parts of the core (nothing or work. Memory Management is responsible for allocating the memory areas of processes and swap space areas, Core Components and buffer cache. Process Management generates processes, and multiple tasks are implemented by switching active processes on the processor.

At the lowest level, the core includes a hardware device driver for each type of hardware it supports. Because there are a large number of different hardware in the world, the number of hardware device drivers is huge. There are many different hardware, so the software control method is different. However, similarity may be classification-driven and supports similar operations. Each member of each type has the same interface as other core components, but the specific implementation is different. For example, all hard drive interfaces are the same as those of other core interfaces, that is, they all have initialization drive, read n sectors, and write n sectors.

Some software services provided by the core itself have similar abstract attributes, so they can be abstracted and classified. For example, different network protocols have been abstracted as a programming interface: BSD socket library. Another example is the virtual filesystem (VFS) layer, which abstracts file system operations from the file system operation implementation. Each file system type provides the implementation of each file system operation. When some entities attempt to use a file system, the request is sent through VFS, which sends the request to the appropriate file system driver.
Main services of UNIX systems

This section describes some of the most important UNIX services, but it is not very detailed. More details will be given in subsequent chapters.

Init

The most important service in UNIX systems is provided by init. Init is the first process that every UNIX system starts at the end of core boot. After init is started, it performs different startup work to continue the boot process (check and mount the file system, start the waken program, etc)
The list of specific tasks performed by init depends on the user's wishes. init has multiple startup options. The single user mode is usually provided. At this time, no user can log on. the root user uses a shell in the console. The common mode is multiuser mode. Generally, this is called run levels. The single-user and multi-user modes can be understood as two run-level instances, and there can be other run-level instances, such as running X on the console.

In normal operations, init confirms that Getty runs normally (allows users to log on) and adopts orphan processes (the parent process is dead; in UNIX, all processes must be in a tree, therefore, the orphan process must be adopted ).

When the system is disabled, init is responsible for killing all other processes, unmount all file systems, and stop the processor.

Log on from the terminal

Log on from the terminal (via the serial line) and the console (when X is not run) are provided by the Getty program. Init starts a separate Getty instance Getty read username for each terminal that allows logon and runs the login program to read the password. If the username and password are correct, login runs the shell. When the shell is terminated, that is, the user logs out, or the login is terminated because the user name and password are incorrect, init knows and starts a new Getty instance. The core does not have the concept of logon, which is handled by system programs.

Syslog

Core and many system programs generate errors, warnings, and other information. This information will often be important in the future. Even a long time later, they should be written to a file. This program is syslog. It can be set to sort the information to different files according to the program or importance of the output information. For example, the core information is often separated from other information and directed to a separate file, because the core information is often more important and needs to be read regularly to determine the problem.

Scheduled command execution: cron and

Users and System Administrators often need to regularly run commands. For example, the system administrator may want to run a program to clear the directory (/tmp and/var/tmp) of the temporary files from the old files to avoid the disk being full, because not all programs correctly clear their temporary files.

The cron service does this. Each user has a crontab, which lists the commands to be executed and the time to be executed. The cron daemon process is responsible for starting the command at a specific time.

The at service is similar to Cron, but it only runs once: The command is executed at a given time, but cannot be repeated automatically.

Gui

UNIX and Linux use user-level programs instead of integrating user interfaces into the core. User Interfaces provide both text and graphic environments.

This arrangement makes the system more flexible, but it is easy to implement different user interfaces for each program, making the system more difficult to learn.

The main graphic environment Used in Linux is the X Window System (X ). X does not implement user interfaces. It only implements one window system, that is, a tool that can implement graphical user interfaces. The three most popular user interface styles based on X are Athena, motif, and open look.

Network

The network connects two or more computers so that they can communicate with each other. The actual connection and communication methods are somewhat complicated, but the results are very useful.

UNIX operating systems have many network features. Basic services: file systems, printing, and backup can all be completed over the network. This makes system management easier because it allows centralized management while gaining the advantages of minicomputers and distributed computing, such as cost reduction and better fault tolerance capabilities.

However, this book only outlines the network. For more information, see the Linux Network Administrator Guide, which includes a basic description of how to operate a network.

Network logon

Network logon is a little different from normal logon. Each terminal that can be logged on has a separate physical serial line. Each user who logs on from the network has a separate virtual network connection and can have any number. Therefore, it is impossible to run separate Getty for each possible virtual connection. Network logon involves several different methods. Telnet and rlogin are the main methods in TCP/IP networks.

Network logon provides a separate daemon program for each logon method (Telnet and rlogin use different daemon programs), instead of using a group of Getty programs to listen for all input login attempts. When a logon attempt is detected, a new instance is started to process the attempt. The original Instance continues to listen for other attempts. The work of the new instance is similar to that of the Getty instance.

Network File System

The most useful thing about network services is to share files through the Network File System of the Network File System. This service generally uses Network File System or NFS, a Network File System developed by Sun.

Through the network file system, any file operation can be sent by a program on one machine to any other machine over the network. This fooled the program into thinking that all the files on other machines are on the machine where the program is running. This greatly simplifies information sharing because it does not require any modifications to the program.

Email

Email is usually the most important method for communication through a computer. An email is stored in a file in a specific format and sent and received using a specific email program.

Each user has an incoming mailbox (a file in a specific format), where all new emails exist. When a recipient sends an email, the email program locates the recipient's email address and adds a letter to the email address file. If the recipient's mailbox is on another machine, the mail will be sent to that machine, and it will use it to deliver the mailbox in the most appropriate way.

The email system includes many programs. Use a program (mail transfer agent or MTA, for example, Sendmail or Smail) to deliver a mail to a local or remote mailbox ), the user uses many different programs (Mail User Agent or MUa, such as pine or Elm ). The email address is usually stored in/var/spool/mail.

Print

At the same time, only one person can use a printer, but it is not economical for all users to share the printer. Therefore, the printer is managed by the software to implement a print queue: all the print tasks are put into one queue. After the printer completes a task, it will automatically print the next one. This removes the need for users to organize print queues and avoids direct control of printers.

The print queue software also prints the output spools to the disk. That is, when the task is in the queue, the print output is stored in a file. This allows the application to quickly complete a print task to the print queue program. The application can continue without waiting until the print task is completed. This is really convenient because it allows you to print out a version, and you do not need to print it, you can continue to modify a new version.

File System layout

The file system is divided into many parts, usually from the root file system:/bin,/lib,/etc,/dev, and some others; /usr file system contains programs and unchanged data;/var file system contains changed data (such as log files);/Home file system contains the personal files of each user. Depending on the hardware configuration and System Administrator's decision, the method is different, and even everything may be in a file system.

Chapter 3 describes the file system layout in more detail.

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.