Service Management (SYSTEMCTL)

Source: Internet
Author: User

1.systemd
System initialization program, system start of the first process, PID 1

2.systemctl command
Systemctl List-units # #列出当前系统服务的状态

Systemctl List-unit-files # #列出服务的开机状态

Systemctl Status sshd # #查看指定服务的状态

Systemctl stop sshd             # #关闭指定服务
systemctl start sshd            # #开启指定服务
systemctl Restart          # #从新启动服务
Systemctl enable sshd           # #设定指定服务开机开启
systemctl disable sshd          # #设定指定服务开机关闭
systemctl Reload sshd           # # To load the specified service from the new configuration
systemctl list-dependencies sshd        # #查看指定服务的倚赖关系
systemctl Mask  sshd            # #冻结指定服务
systemctl unmask sshd           # #启用服务
systemctl set-default multi-user.target # #开机不开启图形
systemctl Set-default graphical.target  # #开机启动图形
setterm                         # #文本界面设定color


3. Service Status
Systemctl Status Service Name

Loaded              # #系统服务已经初始化完成, loaded configuration
active (running)    # #正有一个或多个程序正在系统中执行,
                    #vsftpd is this mode

Atcive (exited)      # #仅执行一次就正常结束的服务,
                     #目前并沒有任何程序在系统中执行

atcive (Waiting) #     #正在执行当中,
                      # But waiting for other events to continue processing

inactive             # #服务关闭
enbaled              # #服务开机启动 Disabled #             #服务开机不自启
Static               # #服务开机启动项不可被管理
failed               # #系统配置错误

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.