systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起

1
2
3
4
5
6
7
8
9
启动nfs服务
systemctl start nfs-server.service
设置开机自启动
systemctl enable nfs-server.service
停止开机自启动
systemctl disable nfs-server.service
查看服务当前状态
systemctl status nfs-server.service
查看所有已启动的服务 systemctl list -units --type=service