企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## systemctl ``` systemctl start <service_name> 启动 systemctl stop <service_name> 关闭 systemctl restart <service_name> 重启 systemctl reload <service_name> 更新配置不重启 systemctl kill <service_name> 杀死一个服务的所有子进程,当stop 失败 systemctl enable <service_name> 开启启动 systemctl disable <service_name> 取消开启启动 systemctl status <service_name> 服务状态 systemctl is-active <service_name> 否正在运行 systemctl is-enable <service_name> 是否开启启动 systemctl cat <server_name> 获取服务配置文件内容 systemctl show <server_name> 显示某个 Unit 的所有底层参数 systemctl list-dependencies <server_name> Unit 依赖关系 systemctl list-unit-files [--type=service] 列出所有配置文件[列出所有服务] systemctl daemon-reload 重新加载配置 ``` ## 示例 ### systemctl list-unit-files --type=service ``` $ systemctl list-unit-files --type=service UNIT FILE STATE auditd.service enabled blk-availability.service disabled brandbot.service static 四种状态 * enabled:已建立启动链接 * disabled:没建立启动链接 * static:该配置文件没有`[Install]`部分(无法执行),只能作为其他配置文件的依赖 * masked:该配置文件被禁止建立启动链接 ```