Systemctl 常用命令

来自linux中国网wiki
跳到导航 跳到搜索
如何激活服务并在启动时启用或禁用服务(即系统启动时自动启动服务)
 systemctl is-active ssh.service
# systemctl enable ssh.service
# systemctl disable ssh.service

如何屏蔽(让它不能启动)或显示服务(如 httpd.service)
# systemctl mask httpd.service
ln -s '/dev/null' '/etc/systemd/system/httpd.service'
# systemctl unmask httpd.service
rm '/etc/systemd/system/httpd.service' 

参考

如何查看linux开机启动项目

Systemd与开机自启动

[ http://man.linuxde.net/systemctl systemctl命令 ]

systemctl 命令完全指南