Mar*_*tin 4 gnome boot upstart
我正在尝试了解 Linux 以及如何从我打开计算机的那一刻开始使用 Gnome 启动 Ubuntu。
我知道内核首先启动,并在完成启动后运行 init 程序(新贵?)。然后 upstart 查看一些配置文件(某处?)并运行 X 和gnome-shell?
那么顺序是什么,所有说明何时开始以及什么开始的配置文件在哪里?
不,我们使用systemd了一段时间。
一旦内核被加载到初始 RAM 磁盘,它就会开始systemd初始化。
systemd使用“目标”处理服务管理过程。中的“目标”文件systemd用于对不同单元进行分组并启动同步过程。
执行的第一个目标systemd是default.target(到graphical.target;的符号链接/usr/lib/systemd/system/graphical.target)
more /usr/lib/systemd/system/graphical.target
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes
Run Code Online (Sandbox Code Playgroud)
这一个触发multi-user.target-> basic.target-> sysinit.target-> local-fs.target-> /etc/fstab,/etc/inittab
这是一种简化,因为它远比这复杂得多:graphical.target向您展示了有关与其他目标的连接的一些事情。这些目标中的每一个都有相同类型的设置,最终导致桌面。
感谢@Rinzwind 为我指明了正确的方向。我最终完成了systemd启动过程,并最终了解了它如何启动 Gnome Shell。
对于正在寻找这个的其他人,这里是过程的过程(至少在 2021 年和 Ubuntu 20.04 中)。我想这可能会在以后的版本中改变。
- Kernel boots
-- Kernel launches /usr/sbin/init (symlink to SysVinit, upstart or systemd)
--- systemd executes /usr/lib/systemd/system/default.target
---- default.target executes /etc/systemd/system/display-manager.service
----- display-manager.service is a symlink to /lib/systemd/system/gdm3.service
------ gdm3.service us a symlink to /lib/systemd/system/gdm.service
------- gdm.service executes /usr/sbin/gdm3
-------- gdm3 starts the X server and after the user logs in executes /usr/share/xsessions/ubuntu.desktop
--------- ubuntu.desktop executes /usr/bin/gnome-shell
Run Code Online (Sandbox Code Playgroud)