1.systemctl 命令

  (1)命令:systemctl list-units   ##列出当前系统服务的状态

unit 8 文档练习_enable

  (2)命令:systemctl list-unit-files   ##列出服务的开机状态

unit 8 文档练习_enable_02

  (3)命令:systemctl status sshd-service  ##查看指定服务的状态

unit 8 文档练习_status_03

  (4)systemctl stop sshd-service      ##关闭指定服务

unit 8 文档练习_status_04

  (5)systemctl start sshd-service      ##开启指定服务

unit 8 文档练习_start_05

  (6)systemctl restart sshd-service     ##重新启动服务

unit 8 文档练习_start_06

  (7)systemctl enable sshd-service      ##设定指定服务开机开启

unit 8 文档练习_start_07

  (8)systemctl disable sshd-service     ##设定指定服务开机关闭

unit 8 文档练习_status_08

  (9)systemctl reload sshd-service     ##使指定服务从新加载配置

unit 8 文档练习_enable_09

  (10)systemctl list-dependencies sshd-service ##查看指定服务的依赖关系

unit 8 文档练习_start_10

  (11)systemctl mask  sshd-service   ##冻结指定服务

unit 8 文档练习_enable_11

  (12)systemctl unmask sshd-service   ##启用服务

unit 8 文档练习_status_12


  (13)systemctl set-default multi-user.target  #开机不开启图形

  (14)systemctl set-default graphical.target   ##开机启动图形

unit 8 文档练习_enable_13

  2.进程的状态

   (1)loaded       ##系统服务已经初始化完成,加载过配置

   (2)active(running)    ##正有一个或多个程序正在系统中执行,vsftpd 就是這種模式

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

   (4)atcive(waiting)   ##正在执行当中,不过还得等其他事件才能继续处理

   (5)inactive        ##服务关闭

   (6)enabled         ##服务开机启动

   (7)disabled        ##服务开机不自启

   (8)static         ##服务开机启动项不可被管理

   (9)failed         ##系统配置错误