The standard script automatically started by osw in linux as the operating system starts.

Source: Internet
Author: User

The standard script automatically started by osw in linux as the operating system starts.

The standard script that osw starts with the startup of the operating system in linux. Osw refers to OS watcher, which is a shell script for monitoring various OS metrics. Osw metric data is generally used by oracle technicians to evaluate the usage of various OS resources. This usage serves as a reference for oracle technicians to evaluate oracle Database behaviors (such as node eviction.

 

[Oracle @ rac2 ~] $ Cat/etc/rc. local #! /Bin/sh # This script will be executed * after * all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch/var/lock/subsys/local/bin/sh/home/oracle/oswbb/autostartosw. sh ---> The above line is newly added.

/Home/oracle/oswbb/autostartosw. sh script content: cd/home/oracle/oswbb/usr/bin/nohup/home/oracle/oswbb/startOSWbb. sh & note: the osw is installed in the/home/oracle/oswbb directory.

 


Detailed Startup Process of the linux operating system (hardware startup sequence)

When the user powers on the PC, BIOS boot self-check, start according to the boot device set in BIOS (usually hard disk,
Start the boot program lilo or grub installed on the device to boot Linux. Linux first performs kernel boot,
Next, run the init program. The init program calls rc. sysinit and rc programs. When rc. sysinit and rc complete the system
After initializing and running a service task, return init; init starts mingetty and opens the terminal for users to log on
Log on to the system. After Successful Logon, the user enters the Shell, which completes the entire startup process from startup to logon.

Load the kernel

After LILO is started, if you choose Linux as the operating system for boot, the first thing to be loaded is the kernel. Remember that there is no operating system in the computer memory at this time, and PC (because of their natural design flaws) has no way to access all the memory on the machine. Therefore, the kernel must be fully loaded into the first MB of available RAM. For this purpose, the kernel is compressed. The header of this file contains the necessary code. First set the CPU to enter safe mode (to lift the memory limit), and then extract the remaining part of the kernel.

Run the kernel

After the kernel is decompressed in the memory, it can start to run. At this time, the kernel only knows its built-in functions, that is, the kernel part compiled as a module cannot be used. Basically, the kernel must have enough code to set its own virtual memory subsystem and root file system (usually ext2 File System ). Once the kernel starts running, the hardware detection determines which device drivers need to be initialized. From here on, the kernel can mount the root file system (this process is similar to Windows's process of identifying and accessing the C drive ). After the root file system is mounted to the kernel, a program called init will be started and run.

Note: here we intentionally omitted many details about Linux kernel startup, which are of interest only to kernel developers. If you're curious, visit the "Kernel Hackers Guide" at http://www.redhat.com: 8080 ".

Init process

The init process is the first non-kernel process to be started, so its process id pid value is always 1. Init reads its configuration file/etc/inittab and determines the Runlevel to be started ). Basically, the running level specifies the behavior of the entire system. Each level (represented by an integer ranging from 0 to 6) meets a specific purpose. If the initdefault level is defined, this value is directly selected. Otherwise, you must enter a value that represents the running level.

After entering a number indicating the running level, init executes a command script program according to the definition in the/etc/inittab file. The default running level depends on the selection of Logon programs in the installation phase: whether to use text-based or X-Window-based logon programs.

Rc command script program

We already know that when the running level changes, the/etc/inittab file will define which command script program to run. These Command Script programs start or stop various services at the specific running level. Because the number of services to be managed is large, you need to use the rc command script program. Among them, the most important one is/etc/rc. d/rc, which is responsible for calling the corresponding command script program for each running level in the correct order. As we can imagine, such a command script program can easily become difficult to control! A well-designed plan is required to prevent such incidents.

For each running level, go to the/etc ....... full text>

LINUX Startup Process

When the user powers on the PC, BIOS boot self-check, start according to the boot device set in BIOS (usually hard disk,
Start the boot program lilo or grub installed on the device to boot Linux. Linux first performs kernel boot,
Next, run the init program. The init program calls rc. sysinit and rc programs. When rc. sysinit and rc complete the system
After initializing and running a service task, return init; init starts mingetty and opens the terminal for users to log on
Log on to the system. After Successful Logon, the user enters the Shell, which completes the entire startup process from startup to logon.

Load the kernel

After LILO is started, if you choose Linux as the operating system for boot, the first thing to be loaded is the kernel. Remember that there is no operating system in the computer memory at this time, and PC (because of their natural design flaws) has no way to access all the memory on the machine. Therefore, the kernel must be fully loaded into the first MB of available RAM. For this purpose, the kernel is compressed. The header of this file contains the necessary code. First set the CPU to enter safe mode (to lift the memory limit), and then extract the remaining part of the kernel.

Run the kernel

After the kernel is decompressed in the memory, it can start to run. At this time, the kernel only knows its built-in functions, that is, the kernel part compiled as a module cannot be used. Basically, the kernel must have enough code to set its own virtual memory subsystem and root file system (usually ext2 File System ). Once the kernel starts running, the hardware detection determines which device drivers need to be initialized. From here on, the kernel can mount the root file system (this process is similar to Windows's process of identifying and accessing the C drive ). After the root file system is mounted to the kernel, a program called init will be started and run.

Note: here we intentionally omitted many details about Linux kernel startup, which are of interest only to kernel developers. If you're curious, visit the "Kernel Hackers Guide" at http://www.redhat.com: 8080 ".

Init process

The init process is the first non-kernel process to be started, so its process id pid value is always 1. Init reads its configuration file/etc/inittab and determines the Runlevel to be started ). Basically, the running level specifies the behavior of the entire system. Each level (represented by an integer ranging from 0 to 6) meets a specific purpose. If the initdefault level is defined, this value is directly selected. Otherwise, you must enter a value that represents the running level.

After entering a number indicating the running level, init executes a command script program according to the definition in the/etc/inittab file. The default running level depends on the selection of Logon programs in the installation phase: whether to use text-based or X-Window-based logon programs.

Rc command script program

We already know that when the running level changes, the/etc/inittab file will define which command script program to run. These Command Script programs start or stop various services at the specific running level. Because the number of services to be managed is large, you need to use the rc command script program. Among them, the most important one is/etc/rc. d/rc, which is responsible for calling the corresponding command script program for each running level in the correct order. As we can imagine, such a command script program can easily become difficult to control! A well-designed plan is required to prevent such incidents.

For each running level, go to the/etc ....... full text>
 

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.