systemctl和journalctl的用法

发布时间 2023-11-30 10:10:20作者: 叶子在行动

systemctl使用方法

 查看当前的服务启动

systemctl list-units --type=service

查看当前服务开机自启,同时过滤程序ConsumerLog

systemctl list-unit-files | grep ConsumerLog

服务启动、状态、停止、重启

启动

systemctl start *****.service

状态

systemctl status*****.service

停止

systemctl stop *****.service

重启

systemctl restart *****.service

 

 

journalctl使用方法

查看服务启动的程序的日志

journalctl  -u  *****(服务名称)