10.26 unit介紹

unit介紹

  • ls /usr/lib/systemd/system //系統全部unit,分爲如下類型:
    • service 系統服務
    • target 多個unit組成的組
    • device 硬件設備
    • mount 文件系統掛載點
    • automount 自動掛載點
    • path 文件或路徑
    • scope 不是由systemd啓動的外部進程
    • slice 進程組
    • snapshot systemd快照
    • socket 進程間通訊套接字
    • swap swap文件
    • timer 定時器

unit相關的命令

  • systemctl list-units //列出正在運行的unit
    • 並會提示,若要列出全部的units,則須要加 --all
  • systemctl list-units --all //列出全部,包括失敗的或者inactive的
  • systemctl list-units --all --state=inactive //列出inactive的unit
  • systemctl list-units --type=service //列出狀態爲active的service
    • 其中failed是一個特例,也會列出來
  • systemctl is-active crond.service //查看某個服務是否爲active
相關文章
相關標籤/搜索