Usage of systemctl on centos 7

Source: Internet
Author: User


Usage of systemctl on centos 7

We are familiar with both the service and chkconfig commands. systemctl is the main tool for service control. It integrates the functions of chkconfig and service.

Systemctl is-enabled iptables. Service

Systemctl is-enabled servicename. Service # query whether the service is started
Systemctl enable *. Service # Start the service
Systemctl disable *. Service # cancel startup
Systemctl start *. Service # Start the service
Systemctl stop *. Service # Stop the service
Systemctl restart *. Service # restart the service
Systemctl reload *. Service # reload the service configuration file
Systemctl status *. Service # query the service running status
Systemctl -- failed # displays services that fail to be started

Note: * indicates the name of a service. For example, the HTTP service name is httpd.

For example, install HTTP on centos 7

[[Email protected] ~] # Yum-y install httpd
Start the Service (equivalent to service httpd start)
Systemctl start httpd. Service
Stop a service (equivalent to service httpd stop)
Systemctl stop httpd. Service
Restart the Service (equivalent to httpd restart)
Systemctl restart httpd. Service
Check whether the service is running (equivalent to service httpd status)
Systemctl status httpd. Service
Auto-Start Service (equivalent to chkconfig httpd on)
Systemctl enable httpd. Service
Disable the service at startup (equivalent to chkconfig httpd on)
Systemctl disable httpd. Service
Check whether the service is started (equivalent to chkconfig -- List)




Usage of systemctl on centos 7

Related Article

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.