加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

典型的Linux内核启动的第一个进程是什么?

发布时间:2020-12-13 19:27:22 所属栏目:Linux 来源:网络整理
导读:我在互联网上搜索了第一个在系统启动时执行的进程. 我找到了两个init和sched的答案.真的是什么? 哪个先执行? sched进程或init进程? 解决方法 通常它是init进程,其路径被硬编码到内核本身. init执行非常低级的功能,例如在Ubuntu(15.40之前)的情况下启动ups
我在互联网上搜索了第一个在系统启动时执行的进程.

我找到了两个init和sched的答案.真的是什么?

哪个先执行? sched进程或init进程?

解决方法

通常它是init进程,其路径被硬编码到内核本身. init执行非常低级的功能,例如在Ubuntu(15.40之前)的情况下启动upstart,或者在Ubuntu 15.04及更高版本的情况下启动系统,Arch,Fedora等,它们加载剩余的进程和设置.请注意,在init运行时系统未完成启动 – 这是一种常见的误解.实际上,init会设置您的登录屏幕和其他相关任务.这是一个关于init: https://en.wikipedia.org/wiki/Linux_startup_process#SysV_init的WikiPedia页面

Init is the father of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab. This file usually has entries which cause init to spawn gettys on each line that users can log in. It also controls autonomous processes required by any particular system. A run level is a software configuration of the system which allows only a selected group of processes to exist. The processes spawned by init for each of these run levels are defined in the /etc/inittab file.

但是,Linux内核确实启动了调度程序,但它不在用户空间中,这是大多数人关联的进程的主页.此外,如果init丢失或无法调用,则可以替换Bourne Shell(/ bin / sh).理论上,您也可以使用此处的init = * some path * Linux内核引导选项将其替换为任何可执行文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读