On the usage of Systemctl in Rhel 7 (alternative service and Chkconfig) _linux

Source: Internet
Author: User

1, Systemctl is Rhel 7 of the service management tools of the main tool, it blends the former service and Chkconfig functions in one. You can use it to enable/disable services either permanently or only in the current session.

Systemctl can list the running service status, as shown in figure:

Systemd-cgls lists the running processes in a tree, which can recursively display control group content. As shown in figure:

2. How do I start/close, enable/disable services?

Start a service: Systemctl start Postfix.service
Turn off a service: Systemctl stop Postfix.service
Restart a service: Systemctl restart Postfix.service
Displays the status of a service: Systemctl status Postfix.service
Enable a service on power-on: Systemctl enable Postfix.service
Disable a service on power-on: Systemctl disable Postfix.service
To see if the service starts: Systemctl is-enabled postfix.service
To view a list of services started: Systemctl List-unit-files|grep enabled
To view a list of services that failed to start: Systemctl--failed

PS: The value obtained by using the command Systemctl is-enabled Postfix.service can be enable, disable, or static, where static it means that there is no definition in the corresponding unit file [ Install] area, so it cannot be configured to boot service.

Description: Enabling services is in the current "runlevel" configuration file directory/etc/systemd/system/multi-user.target.wants/, the establishment of/usr/lib/systemd/ System inside the corresponding service profile soft link; Disabling services is removing this soft link and adding a service is adding a soft connection. As shown in figure:

The above article discusses the usage of SYSTEMCTL in Rhel 7 (substitute service and chkconfig) is a small series to share all the content, hope to give you a reference, but also hope that we support cloud habitat community.

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.