Alpine 执行 rc-x 提示 rc-x not found
问题
在刚运行的Alpine容器中执行rc-service
、rc-status
、rc-update
等rc-x
命令时报错,提示命令不存在。
解决方案
安装 openrc
即可
apk add openrc --no-cache
为什么使用rc-x命令
Alpine 官网文档介绍如下:
OpenRC is the init system used in alpine. The init system manages the services, startup and shutdown of your computer.
OpenRC 是 Alpine 系统初始化及服务管理工具,提供的命令有:
列出所有可用服务
rc-service —list
启动/停止/重启 已有服务
rc-service 服务名 start/stop/restart
更新服务设置
rc-update add/show/delete xxx
详细示例可参考 Alpine官方文档在Working With Alpine中对OpenRc的介绍
还没有评论,来说两句吧...