我们对service和chkconfig两个命令都不陌生,systemctl 是管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。

systemctl is-enabled iptables.service
systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务

注:*代表某个服务的名字,如http的服务名为httpd

例如在CentOS 7 上安装http

[root@CentOS7 ~]# yum -y install httpd
启动服务(等同于service httpd start)
systemctl start httpd.service
停止服务(等同于service httpd stop)
systemctl stop httpd.service
重启服务(等同于service httpd restart)
systemctl restart httpd.service
查看服务是否运行(等同于service httpd status)
systemctl status httpd.service
开机自启动服务(等同于chkconfig httpd on)
systemctl enable httpd.service
开机时禁用服务(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服务是否开机启动 (等同于chkconfig --list)

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-11/109236.htm

CentOS 7 上systemctl 的用法的更多相关文章

  1. CentOS7 上systemctl

    CentOS 上systemctl 的用法 [日期:--] 来源:Linux社区 作者:Linux [字体:大 中 小] 我们对service和chkconfig两个命令都不陌生,systemctl ...

  2. 在CentOS 7上利用systemctl添加自定义系统服务 /usr/lib/systemd/

    在CentOS 7上利用systemctl添加自定义系统服务[日期:2014-07-21] 来源:blog.csdn.net/yuanguozhengjust 作者:yuanguozhengjust ...

  3. CentOS 7.X 中systemctl命令用法详解

    systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体.可以使用它永久性或只在当前会话中启用/禁用服务,下面来看CentOS 7.X 中 ...

  4. 在CentOS 7上利用systemctl加入自己定义系统服务

    CentOS 7继承了RHEL 7的新的特性,比如强大的systemctl,而systemctl的使用也使得以往系统服务的/etc/init.d的启动脚本的方式就此改变,也大幅提高了系统服务的执行效率 ...

  5. CentOS 7上利用systemctl添加自定义系统服务

    Centos 7 之 systemctl CentOS 7继承了RHEL 7的新的特性,例如强大的systemctl,而systemctl的使用也使得以往系统服务的/etc/init.d的启动脚本的方 ...

  6. CentOS 7上的进程管理

    一些杂乱的基础概念 程序是一种静态的文件,躺在磁盘上.而进程则是将程序运行起来放置于内存中.因此进程就是运行中的程序,是程序运行起来的一个实例.同一个程序可以运行为多个进程/实例. 进程之间有父子关系 ...

  7. CentOS 7上的主机名设置和基本网络管理

    主机名 CentOS 6 查看. # hostname 设置. # hostname NEW_NAME 设置完成后,xshell的会话中不会显示NEW_NAME,可通过重新登录会话来显示.不过实际上我 ...

  8. 如何在CentOS 7上安装Percona服务器

    在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品.InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比 ...

  9. 在CentOS 7上安装phpMyAdmin

    原文 在CentOS 7上安装phpMyAdmin phpMyAdmin是一款以PHP为基础,基于Web的MySQL/MariaDB数据库管理工具.虽然已经存在着一些诸如Adminer的轻量级数据库管 ...

随机推荐

  1. C# 使用int.TryParse,Convert.ToInt32,(int)将浮点类型转换整数时的区别

    int.TryParse,Convert.ToInt32,(int) 这几种类型在将浮点类型转换整数时是有差别 Convert.ToInt32则会进行四舍五入 int.TryParse只能转换整数,即 ...

  2. vue - 减少打包后的体积

    打包命令: npm:npm run build yarn:yarn run build 路径:/config/index.js 是否产生map文件,置为false.

  3. LoadRunner中运行场景时提示"You do not have a license for this Vuser type."

    LoadRunner中运行场景时提示"You do not have a license for this Vuser type." 2012-06-15 17:09:07|  分 ...

  4. LaTeX 中文段首空格问题

    一般用 “\\”或者回车可以使得下一段段首空两格,但是对于第一段就不行了. 解决办法:  加一个\usepackage{indentfirst}就可以

  5. mosquitto ---SSL/TLS 单向认证+双向认证

    生成证书 # * Redistributions in binary form must reproduce the above copyright #   notice, this list of ...

  6. GuozhongCrawler系列教程 (4) StartContext具体解释

    StartContext是注入时全部seed的上下文信息假设爬虫在抓取过程其中须要共享一些变量.那么可使用StartContext作为容器. 构造器具体资料 StartContext public S ...

  7. ItelliJ基于Gradle创建及发布Web项目(二)

    上一篇介绍了IteliJ创建WEB项目的过程,这一篇介绍一下和本地WEB服务器(以Tomcat为例)的关联方法和发布流程. WEB服务器的关联 1. 点击IDE右上角的一个带有三角形标识的按钮,如下图 ...

  8. Windows下搭建HTK

    转自:http://blog.csdn.net/yanli0823/article/details/8186382 亲测有效,环境: windows 8.1 perl版本: HTK版本:Hidden ...

  9. vsftp 无法启动,500 OOPS: bad bool value in config file for: anonymous_enable

    朋友的FTP启动不了,叫我帮他看,启动时出现以下错误信息: 500 OOPS: bad bool value in config file for: anonymous_enable 看似配置文件错误 ...

  10. 连接SQLServer的增删改查方法代码

    在Visual C++中用ADO进行数据库编程 1. 生成应用程序框架并初始化OLE/COM库环境 创建一个标准的MFC AppWizard(exe)应用程序CADOConnection,然后在使用A ...