我使用的是 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/