分享

统信桌面专业版【桌面系统常用命令-系统配置-系统和服务管理】

  1. systemd可以管理所有系统资源。不同的资源统称为unit(单元),unit一共分成12种:
  2. Service     #系统服务,守护进程的启动、停止、重启和重载是此类unit中最为明显的几个类型
  3. Target      #多个unit构成的一个组
  4. Device      #硬件设备,此类unit封装一个存在于Linux设备树中的设备每一个使用udev规则标记的设备都将会在systemd中作为一个设备unit出现udev的属性设置可以作为配置设备unit依赖关系的配置源
  5. Mount       #文件系统挂载点,此类unit封装系统结构层次中的一个挂载点
  6. Automount   #自动挂载点,此类unit封装系统结构层次中的一个自挂载点每一个自挂载unit对应一个已挂载的挂载unit
  7. Path        #文件或路径,用于监控指定文件或目录变化,并触发其他unit运行
  8. Scope       #不是由Systemd启动的外部进程
  9. Slice       #进程组
  10. Snapshot    #systemd快照,可以切回unit的某个运行状态
  11. Socket      #进程间通信的socket,此类unit封装系统和互联网中的一个socket当下,systemd支持流式、数据报和连续包的AF_INET、AF_INET6、AF_UNIX socket,也支持传统的FIFOs传输模式
  12. Swap        #swap文件
  13. Timer       #定时器

  14. #例子
  15. systemctl --help                            #查看其他更多参数及其含义
  16. systemctl --version                         #检查您的系统中是否安装有systemd并查询当前安装的版本
  17. systemctl reboot                            #重启系统
  18. systemctl poweroff                          #关闭系统、切断电源
  19. systemctl halt                              #CPU停止工作
  20. systemctl hybrid-sleep                      #让系统进入交互式休眠状态
  21. systemctl rescue                            #启动进入救援状态(单用户状态)
  22. systemd-analyze                             #用于查看启动耗时
  23. systemd-analyze blame                       #查看每个服务的启动耗时
  24. systemd-analyze critical-chain              #显示瀑布状的启动过程流
  25. systemctl list-units                        #可以查看当前系统的所有unit
  26. systemctl list-unit-files                   #列出所有可用单元
  27. systemctl list-units                        #列出所有运行中单元
  28. systemctl --failed                          #列出所有失败单元
  29. systemctl list-units --all --state=inactive #列出所有没有运行的单元
  30. systemctl list-units --type=service         #列出所有正在运行的、类型为service的单元
  31. systemctl status                            #用于查看系统状态和单个unit的状态
  32. systemctl status                            #显示系统状态
  33. systemctl status dbus.service               #显示单个unit的状态
  34. systemctl is-active dbus.service            #查看某个unit是否运行
  35. systemctl start apache.service              #立即启动一个服务
  36. systemctl stop apache.service               #立即停止一个服务
  37. systemctl restart apache.service            #重启一个服务
  38. systemctl kill apache.service               #杀死一个服务的所有子进程
  39. systemctl reload apache.service             #重新加载一个服务的配置文件
  40. systemctl daemon-reload                     #重载所有修改过的配置文件
  41. systemctl enable firewalld.service          #使某服务自动启动
  42. systemctl disable firewalld.service         #使某服务不自动启动
  43. 帮助手册
  44. man [选项] [参数]

  45. #例子
  46. man systemctl #查看systemctl的帮助信息
复制代码


版权说明:论坛帖子主题均由合作第三方提供并上传,若内容存在侵权,请进行举报

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系在线客服