Systemctl usage in RHEL 7 (replacing service and chkconfig), rhelsystemctl

Source: Internet
Author: User

Systemctl usage in RHEL 7 (replacing service and chkconfig), rhelsystemctl

1. systemctl is the main tool in RHEL 7 service management tools. It integrates the functions of previous services and chkconfig. You can use it to enable or disable services permanently or only in the current session.

Systemctl can list the running service statuses,


Systemd-cgls lists running processes in a tree. It recursively displays control group content.



2. How do I start/disable, enable/disable a service?

Start a service:systemctl start postfix.service
Close 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 at startup:systemctl enable postfix.service
Disable a service at startup:systemctl disable postfix.service
Check whether the service is started:systemctl is-enabled postfix.service
View the list of started services:systemctl list-unit-files|grep enabled
View the list of failed services:systemctl --failed

PS: Use the command systemctl is-enabled postfix. the value obtained by the service can be enable, disable, or static. static here means that the [Install] region is not defined in the corresponding Unit file, so the service cannot be configured as a start-up service.

(Enable the service is in the current "runlevel" configuration file directory/etc/systemd/system/multi-user.target.wants, create a soft link corresponding to the service configuration file in/usr/lib/systemd/system. To disable a service, delete the soft link. To add a service, add a soft connection.




-----------------------

(End)



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.