Linux OPS Practice-January 19, 2016-February 3 course Assignments

Source: Internet
Author: User
Tags log log

1, describe the CENTOS6 system boot process;

1) Load the hardware information of the BIOS and self-test, and obtain the first bootable device according to the configuration;

2) Read and run the boot Loader (grub, Spfdisk, etc.) of the MBR in the first boot device;

3) According to the configuration of boot loader loading Kernel, Kernel will start to detect hardware and load drivers;

4) After the hardware driver is successful, Kernel will actively call the INIT program, and Init will get run-level level;

5) Init runs the/etc/rc.d/rc.sysinit file to prepare the operating environment (e.g. network, time zone, etc.) for the software to run;

6) Init runs the various services under Run-level to enable it (script mode);

7) Init run/etc/rc.d/rc.local file;

8) Init run Terminal simulation program Mingetty to start the login program, and finally wait for users to log on;


2, Description/etc/rc.d/rc.sysinit script function;

1) Access to network environment and host information:

Read the network configuration file/etc/sysconfig/network, get the host name and default gateway and other network environment.

2) test and Mount memory device/proc and U disk device/sys:

In addition to mounting the memory device/proc, it also proactively detects if there is a USB device on the system, and if so, it actively loads the USB driver and attempts to mount the USB file system.

3) Decide whether to start SELinux:

4) Start the system random number generator

5) Configure the terminal font:

6) Configure the Welcome information displayed during the startup process;

7) Configure the system time (clock) and time zone configuration: Read-in/etc/sysconfig/clock configuration values

8) Detection of peripheral devices and testing of Plug and Play (PnP) Parameters:

The detection of peripheral devices, such as IDE/SCSI/network/sound effects, and the use of core modules loaded to test the PnP device, are initiated based on the core's detection at startup (/proc/sys/kernel/modprobe).

9) Loading of user-defined modules

The user can add a custom module to the/etc/sysconfig/modules/*.modules and it will be loaded into the system at this time

10) Load the relevant configuration of the core:

The system will take the initiative to read the configuration value of the/etc/sysctl.conf file.

11) Configure host name and initialize Power Management module (ACPI)

12) Initialize the software disk array: mainly through the/etc/mdadm.conf to configure the good.

13) Initialize the file system function of LVM

14) Check disk File system with Fsck: FileSystem check

15) Conversion of disk quota quota (not necessary):

16) Re-mount the system disk in writable mode:

17) Start Quota function: So we do not need to customize the Quotaon action

18) Start the system virtual random number generator (pseudo-random):

19) Clear the cache file during startup:

20) Launch relevant information to load the/VAR/LOG/DMESG file.


3. Summarize the usage of the Text Processing tool sed and awk (must accompany the example)

1) SED


①sed using formats and options

[[Email protected] ~]# [OPTION] ' n1,n2]fun ' [input-file]

OPTION

-N: Use Quiet (silent) mode. In the usage of general sed, all from STDIN

Data is generally listed on the screen. However, if you add the-n parameter, only the

The line (or action) in which the SED is specially processed is listed.

-E: Action editing of SED directly in command-line mode;

-F: Writes the action of SED directly in a file, the-f filename can be run in filename

SED action;

-r:sed's actions support the syntax of extended formal notation. (The default is the basic formal French notation)

-I: Directly modifies the contents of the read file, not the screen output.

N1, N2: Not necessarily exist, usually represents "the number of rows selected for action", for example, if my action

is required between 10 and 20 rows, then "10,20[Action Behavior"

Fun

A: New, a can be followed by a string, and these strings will appear on a new line (the next line)

C: Replace, C can be followed by a string, these strings can replace the line between N1,N2

D: Delete, because is deleted, so d is usually not followed by any string;

I: Insert, I can be followed by the string, and these strings will appear on a new line (the current line);

P: Print, that is, print out a selected data. Normally p will run with the parameter Sed-n ~

S: Replace, can be directly replaced by work! Usually this s action can be paired with formal notation!

For example 1,20s/old/new/g is!

② Instances

            [[email protected] ~]#  cat sed   //edited files              1            2             3            4             [[email protected] ~]#  sed  ' 3ad '  sed    //adds a string after a specified range              1            2             3             d            4             [[email protected] ~]# sed  ' 3d '  sed   //Delete a specified range of rows             1             2             4            [[email  protected] ~]# sed  ' 2,3cno '  sed  //replaces the behavior of the specified range no             1             no            4             [[email protected] ~]# sed  ' 3iok '  sed   //Insert ok            1   before line 3rd            2            ok             3             4            [ [email protected] ~]# sed -n  ' 2,3p '  sed     // Output selected text in silence             2             3             [[email protected] ~]# sed  ' 1,4s/3/ok/g '  sed   //replace 3 with OK             1             2             ok             4 






4, write a script, generate 10 random numbers, and according to the order from small to large (requires at least 2 Chinese law);

5. Execute the script/data/get_username.sh at 1:5 A.M. every Tuesday and output the script to the/tmp/get_username.log log file;

6. Write a script: If a path does not exist, it is created as a directory, otherwise it is present, and the content type is displayed;

7, write a script, print 9x9 multiplication table;

8, describe the work flow of DNS, as well as a complete set of DNS master-slave server, the relevant domain name and IP can be set by itself.


Linux OPS Practice-January 19, 2016-February 3 course Assignments

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.