Systemctl 常用命令

来自linux中国网wiki
Evan讨论 | 贡献2019年10月14日 (一) 13:52的版本 (导入1个版本)
跳到导航 跳到搜索
如何激活服务并在启动时启用或禁用服务(即系统启动时自动启动服务)
 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' 

参考

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

systemctl 命令完全指南