CENTOS7 Service Management (reboot, stop, autostart command)

Source: Internet
Author: User
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.