Cronjobs not working in Docker container

Cannot make/remove an entry for the specified session
Cannot make/remove an entry for the specified session

Some times we may face a strange issue like cronjobs not working in Docker even if the cron service is running. On checking in depth, we can see the above errors in logs.

This can be fixed by running the below command inside the Docker.

#sed -i 's/session    required     pam_loginuid.so/#session    required     pam_loginuid.so/g' /etc/pam.d/cron

Please note that this fix is temporary only. Inorder to make this permanent add this command in Docker file and recreate the image.

That's all…

Leave a Reply

Your email address will not be published. Required fields are marked *