a守护程序是一个背景过程,无需直接用户互动即可运行。 Linux Systems使用不同的init (初始化)系统来管理守护程序。常见的是> systemd,sysvinit和openrc。在本教程中,我们将为Linux中的每个Init System。
了解守护程序,过程和init Systems 1。什么是守护程序?Before getting into the topic, allow me to briefly explain the following key terminologies, as they are important for understanding the rest of the教程。
init System。需要理解过程。什么是守护程序?
a守护程序是一个背景过程,通常在Linux系统上连续运行,通常没有直接的用户交互。
sshd管理ssh连接。
> cron安排任务。
>
daemons通常在系统启动并保持系统启动并继续运行时,直到系统闭合。您使用的是Web服务器,Apache2或Nginx守护程序在后台运行以处理Web请求。
>有趣的事实:
守护程序名称通常以“ D”结尾(例如SSHD,CROND)。
2。什么是过程?编辑器)。
>背景过程:这些没有用户交互(例如,文件下载或系统更新)。
您可以使用PSS或psse
ps aux>示例:
ps aux | grep nano
>
>打开终端时,bash过程开始。如果您运行像ls这样的命令,则创建一个新的过程来执行该命令。
>相关的读取:
- >如何在linux中找到parent Process ID(PPID):linux:sep-by-by-by-by-by-by-by-by of-step Guide
- Linux
>如何找出在Linux
3。什么是Init System?
服务之间的依赖性。
>
示例:
>> >>>>> >
当您启动系统时,init System启动了必不可少的daemons,例如SSHD(SSHD(SSHD(SSHD))和cron System(for Ssh)和cron(for Sshd tasks)和 (背景服务)。ps aux>,但是您需要特定于初始的命令(例如,SystemCtl)来管理
ps aux | grep nano
摘要表
2。使用sysvinit
ps aux
> 说明:
ps aux | grep nanogrep“”→仅在输出中使用[输出)。输出:
>在这里,cron和网络正在运行,而apache2停止。
rc> rc-status
进行服务,例如Alpine Linux和Gentoo。 linuxps --pid 1
命令列表运行daemons | |||||||
---|---|---|---|---|---|---|---|
systemctl List-list-unlits-type-type-type =服务-State = Running | |||||||
sysvinit | 服务-status-all | ||||||
OpenRC | rc-status |
PID TTY TIME CMD 1 ? 00:00:00 systemd结论
Init System | Command to List Running Daemons |
---|---|
Systemd | systemctl list-units --type=service --state=running |
SysVinit | service --status-all |
OpenRC | rc-status |
>
以上是如何列出Linux中的所有运行守护程序的详细内容。更多信息请关注PHP中文网其他相关文章!