32 lines
927 B
Markdown
32 lines
927 B
Markdown
---
|
||
title: "systemd"
|
||
type: entity
|
||
tags: [linux, init-system, service-manager]
|
||
date: 2026-04-16
|
||
---
|
||
|
||
## Definition
|
||
systemd 是 Linux 系统的初始化(init)系统和服务管理器,作为系统的第一个进程(PID 1)运行,负责管理系统服务和socket。
|
||
|
||
## Role
|
||
- 系统和服务管理器
|
||
- 提供服务启动、停止、重启功能
|
||
- 实现 Socket Activation 和其他激活机制
|
||
|
||
## Key Properties
|
||
- PID 1(系统首个进程)
|
||
- 单元文件驱动(.service, .socket, .target)
|
||
- journald 日志系统
|
||
- cgroups 资源管理
|
||
|
||
## Key Commands
|
||
```bash
|
||
systemctl start/stop/restart/status <service> # 服务管理
|
||
systemctl enable/disable <service> # 开机自启管理
|
||
systemctl list-units # 查看单元状态
|
||
```
|
||
|
||
## Connections
|
||
- [[systemd]] ← manages ← [[OpenSSH]]
|
||
- [[systemd]] ← implements ← [[Socket Activation]]
|
||
- [[Ubuntu]] ← ships_with ← [[systemd]] |