12、systemctl 管理命令
1、systemctl
服务管理命令,它实际上将 service 和 chkconfig 这两个命令组合到一起
语法:
systemctl [选项 ] 服务名
选项:
- status 查看当前服务状态
- start 启动服务
- stop 关闭服务
- restart 重启服务
- enable 设置开机启动
- is-enabled 查看某个服务是否是自启动的
- disable 设置开机不启动
- reload 后面不接具体服务名,重新加载配置文件
- mask 注销服务
- unmask 取消注销
systemctl 指令管理的服务在 /usr/lib/systemd/system 查看
systemctl list-units #查看当前已经启动的服务 systemctl list-unit-files [|grep 服务名] #查看服务开机启动状态 systemctl list-dependencies xx.service #查看服务有哪些依赖 systemctl list-dependencies --reverse xx.service #查看服务有哪些依赖(反向) systemctl start nfs-server.service . # 启动nfs服务 systemctl enable nfs-server.service # 设置开机自启动 systemctl disable nfs-server.service # 停止开机自启动 systemctl status nfs-server.service # 查看服务当前状态 systemctl restart nfs-server.service # 重新启动某服务 systemctl list-units --type=service # 查看所有已启动的
本文来自博客园,作者:chao_xiong,转载请注明原文链接:https://www.cnblogs.com/chao-xiong/p/16326913.html

浙公网安备 33010602011771号