0
点赞
收藏
分享

微信扫一扫

Centos7 linux systemd unit的配置文件和管理工具使用

林肯公园_97cc 2024-10-08 阅读 16
Linux运维

配置文件

  • /usr/lib/systemd/system/ #每个服务最主要的脚本文件目录,类似于之前的/etc/init.d/
  • /run/systemd/system/ #系统执行过程中所产生的服务脚本,比上面目录优先运行
  • /etc/systemd/system/ #管理员建立的执行脚本,类似于/etc/rcN.d/Sxx的功能,比上面目录优先运行

systemd的unit通过systemctl工具管理

  • 列出所有己加载到内存且状态为 active 的 service
  • systemctl list-units --type=service
  • 列出所有己加载到内存的 service
  • systemctl list-units --type=service -a
  • 从硬盘中读取数据,列出所有service,包含己加到内存中的数据
  • systemctl list-unit-files --type service --all







举报

相关推荐

0 条评论