Process init init /etc/inittab id:initdefault: runlevel runlevel /etc/rc.sysinit /etc/fstab mount filesystems runlevel /etc/r.d/rc$runlevel.d/ script

Similar documents
Windows 2000 Server for T100

Abstract arm linux tool-chain root NET-Start! 2

Red Flag Linux Desktop 4.0 Red Flag Linux Desktop 4.0 1

Microsoft Word - 新正文.doc

1.ai

1-1 RedHat Hardware Compatibility List 1-2 RedHat HCL

05_資源分享-NFS及NIS.doc

K7VT2_QIG_v3

Windows 2000 Server for T100

2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A. Sun Sun Berkeley BSD University of California UNIX X/Open Company, Ltd.

文 档 修 改 记 录 文 档 编 号 版 本 号 拟 制 人 / 修 改 人 拟 制 / 修 改 日 期 郁 勇 嘉 2012/12/25 初 稿 更 改 理 由 主 要 更 改 内 容 ( 写 要 点 即 可 ) 版 权 所 有, 侵 权 必 究 本 资 料 版 权 属 烽 火 通

ebook62-1

untitled

Guide to Install SATA Hard Disks

untitled

LSI U320 SCSI卡用户手册.doc

ebook140-9

典型自编教材

Microsoft Word - PS2_linux_guide_cn.doc

TX-NR3030_BAS_Cs_ indd

ebook140-8

untitled

id:3:initdefault: si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 2)inittab 文 件 的 结 构 字 段

本文由筱驀釹贡献

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

ebook70-22

自由軟體社群發展經驗與 Linux認證介紹

09 Linux Linux Linux Linux 009.indd /9/4 下午 12:11:10

GUN-GPL / / 2003 ABC for Linux

ebook70-21

05 01 X Window X Window Linux Linux X Window X Window Webmin Web Linux Linux X Window X Window Notebook PC X Window X Window module Linux Linux kernel

Basic System Administration

Cadence SPB 15.2 VOICE Cadence SPB 15.2 PC Cadence 3 (1) CD1 1of 2 (2) CD2 2of 2 (3) CD3 Concept HDL 1of 1

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se

ORACLE Enterprise Linux 6.3下ORACLE11g的安装

P4VM800_BIOS_CN.p65

自由軟體教學平台

Bus Hound 5

Desktop Management Guide

Windows XP

1

PowerPoint Presentation

AL-M200 Series

Pchome

<4D F736F F D20C7B6C8EBCABD6C696E7578BBF9B4A1CAB5D1E92E646F63>

電子商業伺服器管理(終極版).doc

Microsoft Word - linux命令及建议.doc

SA-DK2-U3Rユーザーズマニュアル

TCA Linux 相容性認證測試流程步驟

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

錄...1 說...2 說 說...5 六 率 POST PAY PREPAY DEPOSIT 更

ARM JTAG实时仿真器安装使用指南

Logitech Wireless Combo MK45 English

<55342D323637CBB5C3F7CAE92E786C73>

Microsoft Word - template.doc

Windows Server 2003及Active Directory的除錯及災難回復 (M )

PowerPoint Presentation


KDC-U5049 KDC-U4049 Made for ipod, and Made for iphone mean that an electronic accessory has been designed to connect specifically to ipod, or iphone,

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

HOL-CHG-1695

untitled

スライド 1

Microsoft Word - Front cover_white.doc

スライド 1

声 明 Copyright 2010 杭 州 华 三 通 信 技 术 有 限 公 司 及 其 许 可 者 版 权 所 有, 保 留 一 切 权 利 未 经 本 公 司 书 面 许 可, 任 何 单 位 和 个 人 不 得 擅 自 摘 抄 复 制 本 书 内 容 的 部 分 或 全 部, 并 不 得

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

<4D F736F F D C4EAC0EDB9A4C0E04142BCB6D4C4B6C1C5D0B6CFC0FDCCE2BEABD1A15F325F2E646F63>

AIX系统培训5.ppt

ebook70-7

HLA-B27軟體

RAID RAID 0 RAID 1 RAID 5 RAID * ( -1)* ( /2)* No Yes Yes Yes A. B. BIOS SATA C. RAID BIOS RAID ( ) D. SATA RAID/AHCI ( ) SATA M.2 SSD ( )

<4D F736F F D205F FB942A5CEA668B443C5E9BB73A740B5D8A4E5B8C9A552B1D0A7F75FA6BFB1A4ACFC2E646F63>

Serial ATA ( Nvidia nforce430)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Microsoft Win

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

ebook71-13

P4V88+_BIOS_CN.p65

epub 61-2

1 o o o CPU o o o o o SQL Server 2005 o CPU o o o o o SQL Server o Microsoft SQL Server 2005

Sun Update Connection System Sun Microsystems, Inc Network Circle Santa Clara, CA U.S.A

Acronis True Image 2014

Serial ATA ( nvidia nforce4 Ultra/SLI)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Micro

スライド 1

Chapter 2

资源管理软件TORQUE与作业调度软件Maui的安装、设置及使用

audiogram3 Owners Manual

会计9

穨TX2使用手冊草稿.PDF

投影片 1

团 市 委 首 笔 爱 心 捐 款 及 物 资 已 送 至 芦 山 地 震 灾 区 : 近 日, 团 市 委 从 省 青 少 年 发 展 基 会 获 悉, 团 市 委 为 地 震 灾 区 募 集 的 首 笔 爱 心 捐 款 和 捐 赠 物 资 已 送 至 芦 山 地 震 灾 区 4 月 20 日,

untitled

ebook70-5

<4D F736F F D20EEA3BDDDB7FECEF1C6F7CCD7BCFED3C3BBA7CAD6B2E156332E302E646F63>

ebook 185-6

(Microsoft Word - \264L\261R\245D\270t\306F_\262\304\244\273\263\271.doc)

Linux Ubuntu Part Linux Ubuntu Linux UNIX...19 Linux...19 Linux Linux...21 Linux GNU FSF Open So urce.

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

穨control.PDF

Transcription:

Linux 2-1 1-2 CPU and Memory 1-3 1-4 RAID Software RAID Lab Installing RedHat Linux and Implementing Software RAID Linux F4 ( Files 4 ) lilo.conf grub.conf inittab fstab service chkconfig 2-1 Linux 2-1 Linux 4 1. /etc/lilo.conf 2. /boot/grub/grub.conf 3. /etc/inittab 4. /etc/fstab Linux F4. 2-1 Linux BIOS MBR Partition Kernel Image Read-Only mount / filesystem

Process init init /etc/inittab id:initdefault: runlevel runlevel /etc/rc.sysinit /etc/fstab mount filesystems runlevel /etc/r.d/rc$runlevel.d/ script runlevel 5 /etc/x11/prefdm /etc/sysconfig/desktop

2-1 Linux 2-2 GRUB vs. LILO Redhat Linux Boot Loader GRUB ( Grand Inified Boot-loader ) LILO ( Linux Loader ) GRUB LILO Partition Linux Kernel Image Read-Only mount / filesystem process init LILO GRUB 1st Stage MBR 446bytes boot Sector 2nd Stage boot partition Kernel Image Read-Only mount / filesystem, init

2-2 Boot Loader 2-2-1 GRUB LILO 3-1 GRUB LILO 2-1 GRUB LILO GRUB Default Boot Loader /boot/grub/grub.conf grub-install /dev/hda reinstall GRUB LILO Boot Loader /etc/lilo.conf lilo reinstall LILO lilo t test lilo.conf configuration lilo v install LILO or update configuration lilo u

restore the MBR backup grub.conf lilo.conf lilo Single User Mode Space a 1 Enter Ctrl+X linux 1 GRUB LILO cp /etc/lilo.conf.anaconda lilo timeout 0.1 sec LILO GRUB grub-intall /dev/had timeout 1 sec default label default label hd(0,0) partition root root Single Model GRUB LILO Singel User Mode GRUB Single Mode. GRUB

2-3 GRUB 2. a kernel LABEL=/ 1 b Boot

2-4 GRUB kernel arguments 3. password 2-5 Singel User Mode LILO Single Mode 1. Ctrl-X text Mode 2-6 LILO 2. linux 1 Single User Mode 2-7 LILO Text Mode

MBR MBR 446 bytes boot loader GRUB LILO MBR 446 bytes dd if=/dev/zero of=/dev/had bs=446 count=1 MBR BIOS 3-8 3-9 2-8 BIOS 2-9 MBR 3-9

-- MBR Rescue Mode Rescue Mode. CD boot: linux rescue 2-10 Rescue Mode

2-11 2-12 KeyBoard Type

2-13 2-14

2. Rescue Mode chroot /mnt/sysimage grub-install /dev/hda exit exit 2-15 2-16

2-2-2 /boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/hda2 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz password --md5 $1$gE6Ok/$6vYAf6vYhmf6D2VJqXSIf0 # grub ---------------------------- Label =0 ---------------------------- title Red Hat Linux (2.4.18-14) root (hd0,0) (hd0,0) / kernel /vmlinuz-2.4.18-14 ro root=label=/ initrd /initrd-2.4.18-14.img ---------------------------- Label =1 ---------------------------- title Windows 2000 rootnoverify (hd0,1) # Windows 2000 partition chainloader +1 default=0 (hd0,0) BIOS H.D /boot/grub/device.map (hd0,0) hda1 # this device map was generated by anaconda (fd0) /dev/fd0

(hd0) /dev/hda root (hd0,0) (hd0,0) partition ( grub partition ) / kernel /vmlinuz-2.4.18-14 kernel image / Linux Filesystem /boot ro root=label=/ Read-Only mount Label / partiton Linux / Filesystm root root (hd0,0) root initrd /initrd-2.4.18-14.img Initial RAM disk Initial RAM disk Linux Kernel Image SCSI Software RAID Driver Initial RAM disk image file GRUB Password grub.conf password --md5 $1$gE6Ok/$6vYAf6vYhmf6D2VJqXSIf0 grub $1$gE6Ok/$6vYAf6vYhmf6D2VJqXSIf0 1234 grub-md5-crypt copy password --md5 Single User Mode 1234 [root@rhce root]#grub-md5-crypt Password: 1234 Enter $1$gE6Ok/$6vYAf6vYhmf6D2VJqXSIf0 [root@rhce root]# / filesytem Boot Loader read-only mount / filesystem / init grub.conf kernel /vmlinuz-2.4.18-14 ro root=label=/ kernel /vmlinuz-2.4.18-14 ro root=label=\ init 2-17

2-17 / filesystem 2-2-3 /etc/lilo.conf grub.conf lilo.conf prompt timeout=50 default=linux boot=/dev/hda map=/boot/map # 0.1 # Laeble =Linux # first stage loader MBR # map file install=/boot/boot.b # second loader message=/boot/message linear password redhat restricted # password # password restricted LILO parameter password ( Single User Mode) ########## Laeble =Linux ########## image=/boot/vmlinuz-2.4.18-14 # kernel image label=linux

initrd=/boot/initrd-2.4.18-14.img c read-only append="root=label=/" # Read-Only mount / filesystem ########## Laeble =Windows 2000 ########## other=/dev/hda2 label=windows 2000 /boot/boot.b LILO /boot/boot.b /boot/map kernel kernel /boot/map kernel /boot/boot.b //boot/map rename kernel /boot/map /boot/map kernel label linux Windows 2000 sector 3-3 /etc/inittab process init /etc/inittab script inittab runlevle runlevel runlevel [root@rhce root]# runlevel N 5 inittab

/etc/inittab RHCE # # inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> # Modified for RHS Linux by Marc Ewing and Donnie Barnes # # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: runlevel ( ) # System initialization. si::sysinit:/etc/rc.d/rc.sysinit runlevel rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 runlevel /etc/rc.d/rc.d/* # Things to run in every runlevel. ud::once:/sbin/update # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now Virtual Console CTRL-ALT-DELETE

# When our UPS tells us power has failed, assume we have a few minutes # of power left. Schedule a shutdown for 2 minutes from now. # This does, of course, assume you have powerd installed and your # UPS connected and working correctly. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" # If power was restored before the shutdown kicked in, cancel it. pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 6 Virtual Console # Run xdm in runlevel 5 # xdm is now a separate service x:5:respawn:/etc/x11/prefdm -nodaemon runlevel 5 prefdm /etc/rc.sysinit runlevel script Sets kernel parameters in /etc/sysctl.conf Sets the system clock Loads keymaps Enables swap partitions Sets hostname Root filesystem check and mount Add RAID devise Enable disk quotas Check and mount other filesystems Cleans up stale locks and PID diles /etc/fstab mount filesystems /etc/inittab

l0:0:wait:/etc/rc.d/rc 0 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 runlevel 3 /etc/rc.d/rc3.d/ /etc/rc.d/rc /etc/rc.d/rc # Is there an rc directory for this new runlevel? [-d/etc/rc$runlevel.d] exit 0 # First, run the KILL scripts. for i in /etc/rc$runlevel.d/k* ; do K Scripts check_runlevel "$i" continue # Check if the subsystem is already up. subsys=${i#/etc/rc$runlevel.d/k??} [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \ continue done # Bring the subsystem down. if egrep -q"(killproc action )" $i ; then $i stop else action $"Stopping $subsys: " $i stop fi # Now run the START scripts. for i in /etc/rc$runlevel.d/s* ; do S Scripts check_runlevel "$i" continue # Check if the subsystem is already up. subsys=${i#/etc/rc$runlevel.d/s??} [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \

&& continue # If we're in confirmation mode, get user confirmation if [-n"$confirm"]; then confirm $subsys case $? in 0) :;; 2) CONFIRM=;; *) continue;; esac fi done # Bring the subsystem up. if [ "$subsys" = "halt" -o "$subsys" = "reboot" ]; then unset LANG unset LC_ALL exec $i start fi if egrep -q "(daemon action )" $i 2>/dev/null \ [ "$subsys" = "single" -o "$subsys" = "local" ]; the $i start else action $"Starting $subsys: " $i start fi runlevel /etc/rc.d/rc?.d/ scripts K S Scripts S scripts K scripts # ls l /etc/rc.d/rc*.d/k* more # ls l /etc/rc.d/rc*.d/s* more

2-18 ls l /etc/rc.d/rc*.d/k* more 2-19 ls l /etc/rc.d/rc*.d/s* more /etc/rc.d/rc*.d/ scripts link /etc/rc.d/init.d K* ( Kill ) link service S* ( Start ) link service

/etc/rc.d/init.d/ Scripts System V Startup Scripts runlevel /etc/rc.local Ans : ls l /etc/rc.d/rc*.d/*local runlevel 2~5 Start Link /etc/rc.local runlevel 2~5 /etc/rc.local 2-4 Linux Services Linux services init services ( mingetty Virtual Cosole ) System V Startup Scripts ( /etc/init.d/* scripts atd crond httpd xinetd services ( telnet wu-ftpd ipop3 ) System V xinetd chkconfig services 2-2 service chkconfig service System V chkconfig System V chkconfig xinetd service runlevel on/off xinetd System V servie services # service httpd start httpd server # service httpd stop httpd server # service httpd restart httpd server # service httpd status www server # chkconfig httpd on # chkconfig telnet runlevel 3,4,5 on httpd server # chkconfig httpd off runlevel 3,4,5 httpd server # chkconfig httpd - - list runlevel httpd server # chkconfig - - list runlevel System V services # chkconfig httpd - -del runlevel

httpd # chkconfig httpd - -add runlevel httpd