ndigitals / ols-dockerfiles

Unofficial build of OpenLiteSpeed, High Performance, HTTP/3 supported, ready to use on arm64.
MIT License
7 stars 2 forks source link

Cron does not start automatically #160

Open martin-neumann-gurus opened 6 months ago

martin-neumann-gurus commented 6 months ago

It looks like you have cron included in the image, but it did not start by itself. I could finally activate cron by running /etc/init.d/cron start

However, it would be nice if that would be resolved already on container start. Could that be included?

timnolte commented 6 months ago

Hmm, interesting, so I didn't think I had done anything different with that from the official image. I'll take a look to see what difference there might be. I haven't checked in on the official image repo recently to see what updates might be there that I need to ensure make it into the arm64 image.

I thought this had been working, though to be honest I'm currently using the image on a VPS running Docker and I'm leveraging the VPS host cron to execute jobs within the container, I'm not currently mapping a volume or bind mount for the crontab which would otherwise disappear on restarts. To a degree this is probably why cron is also not started by default.

timnolte commented 6 months ago

So, I did check and by default a Docker won't run cron, also the official Docker image doesn't have cron starting by default either. Depending on how you are starting up your container you could mount and use your own ENTRYPOINT by using a modified version of the default entry point script.

https://github.com/ndigitals/ols-dockerfiles/blob/develop/template/entrypoint.sh