Service Management SYSTEMCLT on Linux learning-centos7

Source: Internet
Author: User

first, the use of SYSTEMCTL management Services

in Centos7, you can use Systemctl to display, start, stop, and restart specified services for easier operation.

1.1 Basic usage

The following is an example of FIREWALLD service, explaining the use of Systemctl

#启动服务systemctl start firewalld# stop service systemctl stop firewalld# Restart service systemctl Restart firewalld# restarts only if the service is running Systemctl Try-restart firewalld# Reload Service Systemctl Reload firewalld# see if the service is running Systemctl is-active firewalld# Displays all services that are currently running Systemctl [list-units]--type servicesystemctl [list-units]-T service# Show all Services Systemctl [List-units]-- Type--allsystemctl [List-units]-at service# show loaded but failed service Systemctl [list-units]--type service- Failedsystemctl [List-units]-T service--failed


1.2 Extended usage

#列出所有系统挂载点systemctl List-unit-files--type=mount

#列出所有可用系统套接口systemctl List-unit-files--type=socket

#获取当前某个服务的CPU分配额 (e.g. httpd) systemctl show-p cpushares Httpd.service

#检查某个服务的所有配置细节systemctl Show httpd

#获取某个服务的依赖性列表systemctl list-dependencies Httpd.service


Second, Systemd-anlyzer

This command looks at the startup time

#查看启动耗时systemd-anlyzer

#查看每个服务的启动耗时systemd-anlyzer Blame

#分析启动时的关键链systemd-analyze Critical-chain

#显示指定服务的启动链systemd-analyze Critical-chain Httpd.service


Third, Hostnamectl

#显示当前主机信息hostnamectl


#设置主机名hostnamectl Set-hostname Centos7


Iv. Localctl

View and set some localization information

#查看本地化localectl

#设置本地化参数localectl Set-locale LANG=EN_GB. Utf-8localectl Set-keymap EN_GB


Wu, Timedatectl

View and set the current time zone

#查看当前时区设置timedatectl # Show all available time zones Timedatectl List-timezones Set the current time zone Timedatectl set-timezone america/new_yorktimedatectl set-time yyyy-mm-ddtimedatectl set-time HH:MM: Ss

Liu, Loginctl

View Current User login information

#列出当前sessionloginctl list-sessions# List The currently logged on user $ loginctl list-users# lists information that displays the specified user Loginctl Show-user ruanyf


Service Management SYSTEMCLT on Linux learning-centos7

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.