我们对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)

systemctl添加开机启动的更多相关文章

  1. Linux centOS Ubuntu --- 使用systemctl添加开机启动

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

  2. ubuntu 添加开机启动服务

    新建umpserver.service [Unit] Description=UMPServer After=syslog.target network.target remote-fs.target ...

  3. (转) CentOS 7添加开机启动服务/脚本

    CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...

  4. centos7如何添加开机启动项?

    centos7提供开启服务启动的方式: 1.系统服务管理命令,如果是通过yum安装的软件,开机启动脚本,已经自动创建好了,直接执行如下命令 nginx.service后缀可以省略 systemctl ...

  5. Centos 7 添加开机启动

    1.添加启动服务 添加docker开机启动服务 [root@localhost ~]# systemctl enable docker.serviceCreated symlink from /etc ...

  6. 不同linux系统添加开机启动程序的命令

    see http://phpcj.org/blog/%E4%B8%8D%E5%90%8Clinux%E7%B3%BB%E7%BB%9F%E6%B7%BB%E5%8A%A0%E5%BC%80%E6%9C ...

  7. centos7之添加开机启动服务/脚本

    一.添加开机启动脚本 #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to ...

  8. windows添加开机启动项

    http://www.cnblogs.com/jokey/archive/2010/06/17/1759370.html添加开机启动项(通过注册表) 例子:增加QQ开机启动项 第一步:找到注册表的启动 ...

  9. Linux 添加开机启动项的三种方法

    linux 添加开机启动项的三种方法. (1)编辑文件 /etc/rc.local 输入命令:vim /etc/rc.local 将出现类似如下的文本片段: #!/bin/sh## This scri ...

随机推荐

  1. macOS 下NFS 文件系统挂载

    主要有两种方式: 使用:resvport选项, mount 挂载命令时. 使用:insecure选项, exportfs 文件配置时. sudo mount -o resvport IP:Addr b ...

  2. 18LaTeX学习系列之---LaTeX的参考文献

    目录 目录 前言 (一)简单的参考文献 1.说明 2.源代码 3.输出效果 (二)以文件管理的方式 1.说明: 2.源代码: 3.输出效果 (三)直接从源网站获取 1.说明 2.操作 目录 本系列是有 ...

  3. 【Beta Scrum】冲刺!4/5

    1. 今日完成情况 人员 学号 分工 是否完成 完成情况 胡武成 031502610 完成登录注册api,协助web端完成api Y 基本逻辑写完,短信部分还在修改中,预计明天早上便能完成 郭剑南 0 ...

  4. 拓普微智能TFT液晶显示模块

    关键词: 串口屏, 液晶屏, TFT,人机界面 概述: 智能模块(Smart LCD)是专为工业显示应用而设计的TFT液晶显示模块. 模块自带主控IC.Flash存储器.实时嵌入式操作系统,客户主机可 ...

  5. 获取href连接并跳转

    获取href连接: <!DOCTYPE html> <html> <head> <script src="/jquery/jquery-1.11.1 ...

  6. web笔试

    类型判断用到哪些方法? typeof和instanceof 值类型和引用类型的区别? 根据 JavaScript中的变量类型传递方式,又分为值类型和引用类型,在参数传递方式上,值类型是按值传递,引用类 ...

  7. WPF防止重复运行实例

    1.方法一 在app.xaml.cs下添加如下代码: /// <summary> /// App.xaml 的交互逻辑 /// </summary> public partia ...

  8. myeclipse中配置spring xml自己主动提示

    版权声明: https://blog.csdn.net/zdp072/article/details/24582173 这是一篇分享技巧的文章:myeclipse中配置spring xml自己主动提示 ...

  9. php 请求另一个服务器接口返回数据

    <?php /** * Created by PhpStorm. * User: thinkpad * Date: 2015/7/17 0017 * Time: 13:24 */ class A ...

  10. keystore密钥文件使用的算法-PBKDF2WithHmacSHA1 和Scrypt

    PBKDF2 简单而言就是将salted hash进行多次重复计算,这个次数是可选择的.如果计算一次所需要的时间是1微秒,那么计算1百万次就需要1秒钟.假如攻击一个密码所需的rainbow table ...