zoukankan      html  css  js  c++  java
  • 对比centos7的systemctl和其他service+chkconfig

    syetemctl就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了。
    systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig 这两个命令组合到一起。

    (一)对比

    任务 旧指令(centos6、5) 新指令(centos7)
    显示所有已启动的服务 chkconfig --list systemctl list-units --type=service
    --all查看所有服务:
    systemctl list-units --type=service --all
    使某服务自动启动 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 (仅显示是否 Active)
    启动某服务 service httpd start systemctl start httpd.service
    停止某服务 service httpd stop systemctl stop httpd.service
    重启某服务 service httpd restart systemctl restart httpd.service

    (二)扩展

    centos7中

    yum install -y A   #安装

    systemctl   status   A   # 管理

    systemctl   start   A 

    systemctl   stop  A 

    systemctl   restart  A 

    systemctl   enable  A 

    systemctl   disable  A 

    systemctl   list-units   --type=service   #  查看所有开机自动启动的服务

  • 相关阅读:
    匹配session
    Jdk1.8+Eclipse+MySql+Tomcat开发Java应用的环境搭建
    MySQL忘记密码怎么办
    MyBatis框架Maven资源
    MyBatis核心配置文件模版
    MyBatis执行过程显示SQL语句的log4j配置
    MyBatis实体类映射文件模板
    Mybatis 学习-4
    Spring Boot + Swagger
    Spring Boot + Swagger
  • 原文地址:https://www.cnblogs.com/andy9468/p/11236638.html
Copyright © 2011-2022 走看看