systemd系統服務控制相關命令

systemd相關命令ssh

pstree
   查看systemd的結構樹

systemd-analyze (time)
   啓動系統到登陸界面的時間,分爲kernel和Userspace兩部分

systemd-analyze blame
   啓動過程當中各服務的花費的時間

systemd-analyze verify
   顯示全部系統單元中是否有語法錯誤

systemd-analyze plot > boot.svg
   將整個引導過程寫入一個Svg格式文件中以便分析(/home/username,用戶文件夾下)

如下systemctl服務管理命令,自己列出運行中的服務清單

systemctl list-units
   不帶多餘信息列出運行中的服務清單

systemctl --all --no-pager | grep -i not-found
   查看掛掉的服務
   sudo systemctl mask ***.service
       把掛掉的服務踢掉
   
systemctl --failed
   列出運行失敗的服務及緣由

systemctl start ***.service
   啓動目標服務(***)

systemctl stop ***.service
   關閉目標服務(***)

systemctl restart,tyr-restart,reload ***.service
   重啓(運行中)或啓動(未運行),重啓(只在運行中的),從新加載(配置文件)

systemctl status ***.service
   檢查服務狀態
systemctl enable/disable ***.service

   設置服務可或不可開機啓動

systemctl is-enabled ***.service
   檢查服務是否開機啓動

遠程管理
systemctl status sshd -H users@address

電源管理
systemctl poweroff 關機
systemctl reboot 重啓
systemctl suspend 待機
systemctl hibernate  休眠svg

相關文章
相關標籤/搜索