ubuntu系统下如何使用systemctl管理系统服务
systemctl list-unit-files #列出所有可用的单元
systemctl list-units #列出所有运行的单元
systemctl is-enabled crond.service #检查某个单元是否启用
systemctl list-unit-files –type=service #列出所有服务
# Linux中如何启动、重启、停止、重载服务以及检查服务(如 httpd.service)状态
systemctl start redis-server.service #开启
systemctl stop redis-server.service #关闭
systemctl restart redis-server.service #重启
systemctl reload redis-server.service #重载
# 查看某项服务是否active
systemctl is-active redis-server
# 开启自启某项服务
systemctl enable redis-server
# 禁止开机自启
systemctl disable redis-server
# 如何屏蔽(让它不能启动)或显示服务
systemctl mask redid-server.service
systemctl unmask redid-server.service
# 使用systemctl命令杀死服务
systemctl kill
# 检查某个服务的所有配置细节
systemctl show redid-server.service
1 条评论