如何在Ubuntu 14上解决“而不是调用init脚本…”

我正在使用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, eg 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, eg start cron 

当我在容器中input/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