Systemctl和service、chkconfig命令的关系

 
  • systemctl命令:是一个systemd工具,主要负责控制systemd系统和服务管理器。
  • service命令:可以启动、停止、重新启动和关闭系统服务,还可以显示所有系统服务的当前状态。
  • chkconfig命令:是管理系统服务(service)的命令行工具。所谓系统服务(service),就是随系统启动而启动,随系统关闭而关闭的程序。
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。
systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。可以使用它永久性或只在当前会话中启用/禁用服务。
所以systemctl命令是service命令和chkconfig命令的集合和代替。
  1. systemctl的用法
    systemctl list-units
    systemctl start firewalld

    systemctl restart firewalld
    systemctl stop fitrwalld
    systemctl disable firewalld
    systemctl enable firewalld
    systemctl
    is-active firewall
    systemctl
    is-enabled firewalld

    systemctl status firewalld
  2. service的用法
    service network restart/start/stop
    service network status
  3. chkconfig的用法
    chkconfig ntpd on/off/reset(永久关闭某个服务)

    chkconfig list

猜你喜欢

转载自www.cnblogs.com/hx1998/p/10923993.html