Reputation: 2167
I'm using a docker container of Ubuntu 14.
$ 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"
When I typed service cron start
in the container, I have the following error. I think the following error doesn't make sence for me because the error should be showed when I use /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
When I typed /etc/init.d/cron start
in the container. The same error is showed as service cron start
Could you tell me how to solve the error and how to start cron
in the docker container?
Upvotes: 2
Views: 2032
Reputation: 374
To run cron daemon you can simply invoke '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
Upvotes: 2