0

On my unRAID server, I am trying to run a Docker container with cron installed and enabled. Here is my very, very simple Dockerfile:

FROM debian:buster-slim

RUN apt-get update && apt-get -y install cron nano

RUN touch /var/log/cron.log

CMD cron && tail -f /var/log/cron.log

The container starts and everything looks fine, however, when I go into the container and type cron, I get this error:

cron: can't lock /var/run/crond.pid, otherpid may be 7: Resource temporarily unavailable

I have tried to just do CMD tail -f /var/log/cron.log to keep the container alive, but the result is the same. service cron status shows cron is running.

What else do I need to do, to get cron working on a bare minimum Debian Buster image?

1 Answer 1

1

This is probably because cron is already running!

Try:

CMD tail -f /dev/null

to keep the container running while you try things manually

1
  • Cron was not running, unfortunately. I ended up going with scripts instead, so my cron is handled in unRAID insead. Jan 21, 2021 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .