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中文網其他相關文章!