docker - 如何在 Ubuntu 14 上解决 "Rather than invoking init scripts...."

标签 docker ubuntu-14.04

我使用的是 Ubuntu 14 的 docker 容器。

$ cat /etc/lsb-release # this is in the container
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

当我在容器中输入 service cron start 时,出现以下错误。我认为以下错误对我来说没有意义,因为当我使用 /etc/init.d/cron start 时应该显示该错误。

$ service cron start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service cron start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start cron

当我在容器中输入 /etc/init.d/cron start 时。同样的错误显示为 service cron start

您能告诉我如何解决该错误以及如何在 docker 容器中启动 cron 吗?

最佳答案

要运行 cron 守护进程,您只需调用“cron”即可:

root@89bdd8666c95:# cron   
root@89bdd8666c95:# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 14:56 ?        00:00:00 bash
root        88     1  0 15:02 ?        00:00:00 cron
root        89     1  0 15:02 ?        00:00:00 ps -ef

关于docker - 如何在 Ubuntu 14 上解决 "Rather than invoking init scripts....",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41264090/

相关文章:

angular - 启动容器导致错误

docker - docker从容器运行python

java - 程序 'mvn'可以在以下包:中找到

MySQL 错误访问被拒绝

javascript - 永远启动命令不起作用

linux - 虚拟机 apt-get grub 问题

docker - 为 2 个不同的 DLT 网络重新使用 Hyperledger Fabric 中的对等点/节点

docker - 向主机 Kafka 服务器生成消息时出现容器化 Kafka 客户端错误

c# - 无法从使用自定义运行时在 Docker 中运行 .NET Core 应用程序的 App Engine 连接到 Google Cloud SQL 中的 postgres

ruby-on-rails - 如何管理造成停机的旅客过时 worker