我正在尝试使用 init-checkconf
对 upstart 脚本进行语法检查。但是,当我运行它时,它会返回 ERROR: version of/sbin/initctl too old
。
我不知道该怎么做,我尝试重新安装 upstart 但没有任何变化。这是从 docker 容器 (ubuntu:14.04) 中运行的,这可能与它有关。
最佳答案
我刚刚遇到了同样的问题。
查看容器:
root@puppet-master:/# cat /sbin/initctl
#!/bin/sh
exit 0
我还没有完全测试它,但我在我的 Dockerfile 中添加了以下内容:
# Fix upstart
RUN rm -rf /sbin/initctl && ln -s /sbin/initctl.distrib /sbin/initctl
我以为 this链接解释得很好:
When your Docker container starts, only the CMD command is run. The only processes that will be running inside the container is the CMD command, and all processes that it spawns. That's why all kinds of important system services are not run automatically – you have to run them yourself.
进一步挖掘,我发现了一个官方 Ubuntu 镜像,其中包含一个 Upstart 的工作版本: https://registry.hub.docker.com/_/ubuntu-upstart/
关于docker - initctl 太旧 Upstart 检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28596795/