Usage of Systemctl in RHEL 7

Source: Internet
Author: User

    1. # SYSTEMCT

      Systemctl can list the status of a running service

2. # Systemd-cgls

SYSTEMD-CGLS lists the running processes in a tree, which can recursively display control group content


3. How do I start/turn off, enable/disable services?

Start a service:systemctl start postfix.service
To close a service:systemctl stop postfix.service
To restart a service:systemctl restart postfix.service
Displays the status of a service:systemctl status postfix.service
enable a service at boot time:systemctl enable postfix.service
Disable a service at boot time:systemctl disable postfix.service
To see if the service is booting up:systemctl is-enabled postfix.service
to view a list of services that have been started:systemctl list-unit-files|grep enabled
to view a list of services that failed to start:systemctl --failed

PS:使用命令 systemctl is-enabled postfix.service 得到的值可以是enable、disable或static,这里的 static 它是指对应的 Unit 文件中没有定义[Install]区域,因此无法配置为开机启动服务。 

Description: The Enable service is in the current "runlevel" configuration file directory/etc/systemd/system/multi-user.target.wants/, establish/usr/lib/systemd/ A soft link within the system that corresponds to a service profile; Disabling a service is removing this soft link, adding a service is adding a soft connection


Turn on SVN self-booting:

# Systemctl Enable Svnserve.service


Usage of Systemctl in RHEL 7

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.