我正在使用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
?
答案 0 :(得分:1)
要运行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