前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >systemctl命令详解

systemctl命令详解

作者头像
用户2936342
发布2018-08-27 15:21:18
1.1K0
发布2018-08-27 15:21:18
举报
文章被收录于专栏:nummynummy

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

任务

旧指令

新指令

使某服务自启

chkconfig --level 3 httpd on

systemctl enable httpd.service

使某服务不自动启动

chkconfig --level 3 httpd off

systemctl disable httpd.service

检查服务状态

service httpd status

systemctl status httpd.service 或者 systemctl is-active httpd.service

显示所有已启动服务

chkconfig --list

systemctl list-units --type=service

启动某服务

service httpd start

systemctl start httpd.service

停止某服务

service httpd stop

systemctl stop httpd.service

重启某服务

service httpd restart

systemctl restart httpd.service

实例

1.启动nfs服务

代码语言:javascript
复制
systemctl start nfs-server.service

2.设置开机自启动

代码语言:javascript
复制
systemctl enable nfs-server.service

3.停止开机自启动

代码语言:javascript
复制
systemctl disable nfs-server.service

4.查看服务当前状态

代码语言:javascript
复制
systemctl status nfs-server.service

5.重新启动某服务

代码语言:javascript
复制
systemctl restart nfs-server.service

6.查看所有已启动的服务

代码语言:javascript
复制
systemctl list -units --type=service
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017.07.07 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 实例
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档