Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am running docker in amazon linux. I have setup a cron job for a specific action. It returns an error stating Cannot make/remove an entry for the specified session Docker Version : 1.12.6 (Client and Server) API Version : 1.24 (Client and Server)

like image 618
Prabhu Khanna Mahadevan Avatar asked Apr 10 '17 12:04

Prabhu Khanna Mahadevan


1 Answers

That error is usually due to a pam security issue.

It has been fixed in debian recently: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726661 and in Ubuntu Wily (15.10).

As a workaround you can try commenting the module pam_loginuid.so inside /etc/pam.d/cron and restart cron (or the docker container).

You can use something similar to this in your Dockerfile:

RUN sed -i '/session    required     pam_loginuid.so/c\#session    required   pam_loginuid.so' /etc/pam.d/cron
like image 133
Vicente Quintans Avatar answered Oct 20 '22 00:10

Vicente Quintans