bash – Docker:Cronjob无法正常工作
我试图在Docker容器上运行cron作业.我有一个正在运行的容器(Fedora 20).
我还在容器中安装了cron包并显式运行了cron守护进程. 我还检查了cron.deny文件是否为空,并且/ etc /目录下没有名为cron.allow的文件. Whenever I tried to set the cronjob by using crontab -e or trying to list the cron job using crontab -l I am getting following error. bash-4.2# crontab -l You (root) are not allowed to access to (crontab) because of pam configuration. bash-4.2# crontab -e You (root) are not allowed to access to (crontab) because of pam configuration. 我还检查了它后面的/etc/pam.d/crond文件 bash-4.2 #vi /etc/pam.d/crond # # The PAM configuration file for the cron daemon # # # No PAM authentication called,auth modules not needed account required pam_access.so account include password-auth session required pam_loginuid.so session include password-auth auth include password-auth 有谁遇到过这个问题?如果是的话,请你指点一下吗? 提前致谢.
LXC容器不是虚拟机.你需要在前台明确地运行cron守护进程.更好的是仍然从
Supervisor或
runit等程序运行cron.
参考:Docker documentation
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |