首页 > 代码库 > systemd简单指令

systemd简单指令


查看
查看系统状态

1 systemctl status

查看单个单元运行状态

1 systemctl status [单元]

查看所有可用单元

1 systemctl list-unit-files

查看开机进程

1 systemd-analyze

查看各个服务启动花费的时间

1 systemd-analyze blame

重新载入systemd并扫描可用单元

1 systemctl daemon-reload


管理服务
启动&停止&重启单元

1 systemctl start [单元]
2 systemctl stop [单元]
3 systemctl restart [单元]

设置/取消单元开机自启,查看单元是否设置为开机自启

1 systemctl enable [单元]
2 systemctl disable [单元]
3 systemctl is-enabled [单元]

禁用/取消禁用单元

1 systemctl mask [单元]
2 systemctl unmask [单元]

 

systemd简单指令