The New Process No. 1 of Linux -- SystemD

56 %
44 %
Information about The New Process No. 1 of Linux -- SystemD

Published on March 14, 2014

Author: freedman6022e20



Showing what systemD is. These slides had been wrote in traditional chinese.

全新的 Linux 一號行程-- systemd by Freedman 2014-03-04 Q__ f"_< ○ ○▽ ............. 自由車上自由人

常見的一號行程 ● init: debian, archlinux ~2012-10-12, BSD... ● upstart: Ubuntu 6.10~, Fedora 9~14 ● systemd: Fedora 15~, archlinux 2012-10-13~, Mageia 2, Mandriva 2011, openSUSE 12.1~

常見的系統開機過程 GRUB/LILO/... 載入系統 核心以 Initrd 設定系統 Init Systemd Init (upstart) SysV int | Systemd prefdm gdm kdm... mingetty... gnome PowerOn BootLoader Splash Kernel InitRAMFS Init Services (Runlevel) mate sugar xsession... kde startx

systemd 專案 ● 由 Lennart Poettering 與 Kay Sievers 開發 ● Linux 上的系統與服務管理程式 ● 可以相容、取代 init ● 主要效益:快速啟動、服務程式的線上抽換 ● 以 LGPL v2.1+ 發行 ● 已經在很多 Linux 發行版中被採用

運作概念 ● init: 設定檔是文件和 shell 腳本,以啟動各種行程為系 統的運作概念 – /etc/inittab /etc/init.d /etc/rc[0~6].d/ ● upstart: 基於事件,在事件發生時啟動各種程式,還能支援 變動的硬體環境 – /etc/init/ (/etc/event.d/) ● systemd: 基於 socket, 先將各種服務的 socket 建立,然後 各種程式可以同時啟動

systemd 架構圖 圖片取自維基百科

systemd 的特色 ● 啟動速度較快 – 不使用 shell script – 各服務平行啟動(只在 SSD 上才會加快) ● 提供系統服務快照 ● 掛載及自動掛載管理 ● 以事務系統 (transaction) 處理相依服務 ● 服務的無感即時更新、重新啟動與暫時結束 ● 使用 Linux 核心 cgroup 功能進行管理

Target vs. Runlevel SysVinit systemd init 0 systemctl poweroff init 1 systemctl isolate init 3 systemctl isolate init 5 systemctl isolate init 6 systemctl reboot ● 以目標取代執行等級的概念 ● 相關檔案: – /lib/systemd/system/*.target – /etc/systemd/system/

systemd 的設定檔 位置: /lib/systemd/ /lib/systemd/system/ /etc/systemd/ /etc/systemd/system/ 主要類型: XXX.service XXX.socket 這些檔案由建構整個 發行版的工程師們撰 寫,一般的系統管理 員通常不需要自行修 改。 → [Unit] Description=Graphical Interface Documentation=man:systemd.special(7) Wants=display-manager.service AllowIsolate=yes [Install]

iscsid.service [Unit] Description=Open-iSCSI Documentation=man:iscsid(8) man:iscsiadm(8) DefaultDependencies=no iscsiuio.service [Service] Type=forking PIDFile=/var/run/ ExecStart=/usr/sbin/iscsid ExecStop=/sbin/iscsiadm -k 0 2 [Install]

iscsid.socket [Unit] Description=Open-iSCSI iscsid Socket Documentation=man:iscsid(8) man:iscsiadm(8) [Socket] ListenStream=@ISCSIADM_ABSTRACT_NAMESPA CE [Install]


其他相關命令與套件 ● 服務的管理 systemctl start/stop/restart foo.service 立刻啟動、重新啟動或停止服務 systemctl status foo.service 查看服務狀態 systemctl enable/disable foo.service 設定使用或不使用某服務(只會設定在目前的 target ) ● 分析工具: systemd-analyze 套件 systemd-analyze blame 列出最耗時的 systemd-analyze plot > out.svg 製作時序圖

參考資料 ● systemd man page ● 鳥哥的私房菜 ● Itsmw ● systemd System and Service Manager ● Systemd/zh-hant - The Chakra Project ● (=..=)/: systemd-analyze

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Systemd - FedoraProject

systemd is a system and service manager for Linux, ... (similar to run level 1); systemd.unit=emergency ... systemd-cgls lists the running process in a ...
Read more

The systemd Daemon | Reference | openSUSE Leap 42.1

The program systemd is the process with process ID 1. ... systemd introduces a new concept ... root # systemd-cgls --no-pager ├─1 /usr/lib/systemd ...
Read more

Managing Services on Linux with systemd |

Managing Services on Linux with systemd ... You've read all about systemd, the new Linux init ... systemadm is a nice graphical systemd manager (figure 1).
Read more

systemd -

Defaults to no. _status= ... (1) and the systemd process. ... [1] If run inside a Linux container these arguments may be passed as ...
Read more

systemd(1) - Linux manual page - Michael Kerrisk

SYSTEMD(1) ... even if the process ID is not 1, i.e. systemd is ... Processes systemd spawns are placed in individual Linux control ...
Read more

systemd in SUSE® Linux Enterprise 12 - White Paper

Introduced with SUSE ® Linux Enterprise 12, systemd ... runs.with.a.process.ID.(PID).of.1 ..But ... The systemd Journal. Theystemd.s ...
Read more

Systemd Service Unit Configuration -

The service process may be the main service process, but it ... Example 1. Simple service. ... Since no ExecStop= was specified, systemd will send ...
Read more

systemd - Wikipedia, the free encyclopedia

... space's process tree; the first process (pid 1) ... systemd version 215 was released, adding new features ... systemd supports only Linux and ...
Read more

Chapter 9. Unix Services - Debian

Boot sequence of a computer running Linux with systemd. ... systemd[1]: ssh.service: main process ... missing services and stop those that are no ...
Read more