CentOS7 Service Management (reboot, stop, autostart command)
We are not unfamiliar with service and chkconfig two commands, Systemctl is the main tool of the control service, it integrates the Chkconfig and service function in one.
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 #显示启动失败的服务
Note: * Represents the name of a service, such as the HTTP service name httpd
For example, to install HTTP on CentOS 7
[Root@centos7 ~]# yum-y Install httpd
Start service (equivalent to services httpd start)
Systemctl Start Httpd.service
Stop services (equivalent to service httpd stop)
Systemctl Stop Httpd.service
Restart services (equivalent to service httpd restart)
Systemctl Restart Httpd.service
To see if the service is running (equivalent to httpd status)
Systemctl Status Httpd.service
Power-on Self-boot service (equivalent to Chkconfig httpd on)
Systemctl Enable Httpd.service
Disable service on power-on (equivalent to Chkconfig httpd on)
Systemctl Disable Httpd.service
To see if the service is powered on (equivalent to Chkconfig--list)