Linux startup process:
- 浏览: 153816 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (146)
- Android (1)
- SpringFramework (11)
- Maven (4)
- Flex (14)
- DesignPattern (10)
- JavaSE (29)
- Hibernate (0)
- JDBC (4)
- MySQL (16)
- JavaWeb (4)
- JavaScript (5)
- Lucene (7)
- Linux (14)
- Java-Logging (6)
- Miscellanies (5)
- Spring MVC (2)
- Vim (1)
- Java POI (4)
- Eclipse (3)
- Financial Terminology (1)
- Guava (5)
- Data Structure & Algorithm (1)
- Python (0)
最新评论
-
DavyJones2010:
knightdf 写道freezingsky 写道这年头代码和 ...
Java SE: How to Decompress File (.zip) -
knightdf:
freezingsky 写道这年头代码和内容都是copy来co ...
Java SE: How to Decompress File (.zip) -
freezingsky:
这年头代码和内容都是copy来copy去的,至少讲一讲过程分析 ...
Java SE: How to Decompress File (.zip)
1. inittab file (/etc/inittab)
1. All the entries in inittab file are stored with format below:
id:run-levels:action:process
id --> identifier, usually two alphabets or two degits.
run-levels --> digit from 0-6. multiple run-level can be assigned.
action --> represents the running status
process --> represents the script/command that need to be executed.
process is our main focus, and we can even ignore the id.
action: 1> initdefault: the system default run level 2> sysinit: 3> wait: the command marked wait means the commands after this line can be executed only after the execution of this command. 4> once: start a new process and execute the command, the commands after it don't have to wait the execution of it. 5> ctrlaltdel: the command will be executed when we press ctrl+alt+del 6> powerfail: when there is error with battery/power, the command specified will be executed, and don't have to wait for end of the execution. 7> powerokwait: when the battery/power back to normal, the command specified will be executed. 8> respawn: whenever the command executed, the command should be executed again. It a command execution loop. # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now
Sometimes we may install sendmail, and it will execute when we start up. And its default action is wait, that means other commands have to wait the execution of it. That would take a lot of time.
# 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 # In linux, tty means local terminal # We can press ctrl+alt+F1~F6 to shift between different theres terminals. # If we press ctrl+alt+F7/F8 then we will shift to x-window terminal
si::sysinit:/etc/rc.d/rc.sysinit # id -> si # run-levels -> empty means this init script/command should be executed no matter what the current run-level is l0:0:wait:/etc/rc.d/rc 0 # id -> l0 # run-levels -> 0 means only execute "/etc/rc.d/rc 0" when current run level is 0 pr:12345:powerokwait:/sbin/shutdown
2. First effective line in inittab file:
id:5:initdefault
1. The default run-level is 5 which means multi-user and x-window running level.
2. We can modify this line to change the default running level when system startup.
3. There is no process script assigned in this line, why?
3. Second effective line in inittab file:
si::sysinit:/etc/rc.d/rc.sysinit
1. run-level is empty, means whatever current run-level is, this "etc/rc.d/rc.sysinit" will always be executed.
2. "etc/rc.d/rc.sysinit" is a shell script. If we want an operation executed when the system startups, we can add the command at the end of this file.
4. Third segment in inittab file
l0:0:wait:/etc/rc.d/rc 0 l0:1:wait:/etc/rc.d/rc 1 l0:2:wait:/etc/rc.d/rc 2 l0:3:wait:/etc/rc.d/rc 3 l0:4:wait:/etc/rc.d/rc 4 l0:5:wait:/etc/rc.d/rc 5 l0:6:wait:/etc/rc.d/rc 6
1. As the "etc/rc.d/rc.sysinit" is the commom script for any run-levels, how can we make the difference between different run-levels?
That is how can we make sure run-level 5 will show an x-window and run-level 3 will not?
This is the function of segment above.
2. "etc/rc.d/rc" is a executable shell script file
ls -l /etc/rc.d/rc -rwxr-xr-x 1 root root 2255 Jul 4 2009 /etc/rc.d/rc
3. "etc/rc.d/rc 0" as we pass 0 to the script, the actual running script is stored in "etc/rc.d/rc0.d" directory
etc/rc.d/rc0.d etc/rc.d/rc1.d etc/rc.d/rc2.d etc/rc.d/rc3.d etc/rc.d/rc4.d etc/rc.d/rc5.d etc/rc.d/rc6.d ls /etc/rc.d init.d --> direcotory rc0.d --> direcotory rc1.d --> direcotory ... --> direcotory rc.sysinit --> file rc --> file rc.local --> file
4. What stores in "etc/rc.d/rc3.d"?
ls /etc/rc.d/rc3.d K01dnsmasq K02avahi-dnsconfd K02NetworkManager K05conman K85mdmpd S12restorecond S55sshd
1) S = start, means in this run level, we need to start this server.
2) K = kill, means in this run level, we need to kill this server.
Why should we have K ? As long as we have S, wouldn't that be enough?
For the benefit of shifting between different run-levels.
The number after S/K means the priority of starting/killing.
The smaller the number is, the higher priority the service is.
The last part is the name of the service script.
发表评论
-
Linux: Frequently used command
2014-11-03 17:05 6621. List disk space usage: df ... -
Linux Shell Introduction III
2013-12-07 23:20 6851) select var in keywords do ... -
Linux Shell Introduction II
2013-12-05 23:49 5761. How to test variable 1) E ... -
Linux Shell Introduction I
2013-12-03 23:47 4741. A simple shell script: #! ... -
Linux: Process Management
2013-11-11 23:12 548syllabus: 1. Basic Concept o ... -
Linux: Startup Analysis I -- Overall intro
2013-11-06 23:21 517Linux startup process: ... -
Linux: Startup Analysis II -- GRUB analysis
2013-11-06 23:56 1014Question Summary: 1> What ... -
Linux: Basic Command: Software Package Management
2013-10-24 08:58 01. Introduction: 1) RedHat So ... -
Linux: Basic Command Introduction VII
2013-10-18 14:23 0User Group Permission Manageme ... -
Linux: Basic Command Introduction VI
2013-10-14 00:44 610User Management Related Comma ... -
Linux: Basic Command Introduction V
2013-10-10 23:18 620Part I: Network Related Comma ... -
Linux: Basic Command Introduction IV
2013-09-25 01:32 864Part I: Help command 1) C ... -
Linux: Basic Command Introduction III
2013-09-23 09:08 7511) Command Name: useradd ... -
Linux: Basic Command Introduction II
2013-09-19 22:36 4681) Command Name: cat ... -
Linux: Basic Command Introduction
2013-09-17 08:52 7341. File Name convention: ...
相关推荐
关于对2022.1.1以后VHLS不能生成IP核的解决补丁
Error #541: 'NordicSemiconductor::Device:Startup:8.27.0' component is missing (previously found in pack 'NordicSemiconductor.nRF_DeviceFamilyPack_NordicLicense')
Startup Pitch Perfect - 初创公司的。 Startup Pitch Perfect 会根据“X 换 Y”的比喻自动生成一个随机的启动和标准推介平台(例如市场、产品、战略、团队)的所有幻灯片,向您的朋友推介。 现在轮到你了! 本...
- 思科:`show startup-config` - 华为:`display saved-configuration` - H3C:`display saved-configuration` 13. 显示当前配置: - 思科:`show running-config` - 华为:`display current-configuration` ...
在Java Web开发中,`load-on-startup`节点是一个至关重要的概念,特别是在Servlet容器(如Tomcat)中。这个节点通常出现在Servlet的配置文件——web.xml中,它用于指定Servlet在Web应用程序启动时的加载顺序。`load-...
- **STARTUP_TIME**:启动时间。 - **LAST_BROWSED_SEQ**:最后浏览序列号。 - **LAST_BROWSED_NUM**:最后浏览编号。 - **LAST_DEQUEUE**:最后出队时间。 #### 全球固定视图(GV$ views) **概述:** 除了...
5. **启动、停止和管理**:Apache Tomcat提供了一系列的脚本用于管理服务,如`bin/startup.sh`用于启动Tomcat,`bin/shutdown.sh`用于关闭Tomcat。这些脚本需要使用`sudo`权限执行。 6. **配置**:Tomcat的配置文件...
【标题】"Startup-Bytedrops-2021"是一个与初创公司Bytedrops在2021年的活动或项目相关的主题。这个标题暗示了可能包含的是该公司的技术文档、项目代码、会议记录或者市场策略等内容,尤其关注点在于其在2021年的...
Linux/Unix/Mac启动命令(standalone代表着单机模式运行,非集群模式):sh startup.sh -m standalone如果您使用的是ubuntu系统,或者运行脚本报错提示[[符号找不到,可尝试如下运行:bash startup.sh -m ...
2)....Fixed: Range check error in processes information for x64 machines (affects startup of any EurekaLog-enabled module) 3)....Fixed: Auto-detect personality by project extension if --el_mode switch...
2010-8-11 18:24:13 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 984 ms 2010-8-11 18:24:13 org.apache.catalina.core.StandardService start 信息: Starting service Catalina ...
- **Bypass primary startup volume and seek a different startup volume (such as a CD or external disk)**:启动时按下 `Option-Command-Shift-Delete`,这可以让你跳过默认的启动磁盘,选择其他的启动介质如 CD...
### C51启动文件STARTUp.A51详细解析 #### 文件概述 《C51启动文件--STARTUp.A51--详细注释.docx》是一份关于C51语言编程中启动文件(STARTUp.A51)的详细介绍文档。这份文档主要针对的是使用Keil C51编译器进行...
- 思科:`erase startup-config`或`delete flash:startup-config` - 华为:`delete configuration` 9. **加密密码** - 思科:明文`0`,密文`7` - 华为:未直接提及,但可以使用`service password-encryption`...
解压后,我们可以看到一个名为"XShell5-Startup-Script-master"的文件夹,这通常包含了脚本源代码、使用说明或其他相关辅助文件。用户需要根据自己的操作系统环境,对脚本进行适当的修改和配置,然后将它设置为...
弹簧启动分析仪 该项目被设计为一个模块,您可以通过Maven引入,它会生成类似于下... <artifactId>spring-startup-analysis <version>1.1.0 将以下基本软件包添加到您的组件中: com.github.lwaddicor.springstartu
其中,-STARTUP 指定启动服务,-SID 指定服务的 SID,-USRPWD 指定服务的口令,-STARTTYPE 指定服务的启动类型,-PFILE 指定服务的参数文件。 关闭服务的基本语法为: oradim -SHUTDOWN -SID sid [-USRPWD 口令] ...
Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.4 to 11.1.0.6 ...NOTE:419871.1 - Failures due to "skgxpvfymmtu: process failed because of a resource problem in the OS" on 32-bit Linux