I have a cronjob in /etc/cron.d/mycron that looks like this:
0 3 * * * apache php /path/to/my/script.php
In the same file there are other cronjobs begin run as root and other users (which work), but for some reason this job running as apache isn't running and isn't reporting anything in /var/log/messages or sending anything to the MAILTO address in the cron file. When I su apache and run the cronjob's command, it works fine, but cron doesn't like it.
This is a long running problem for me and so far I have gathered the following possibilities:
- The apache user doesn't have a home directory (the other cron users do), and crond doesn't like this.
- There's some PAM or
/etc/security/access.confsetting blocking apache using crond, although/etc/security/access.confis completely commented out. - SELinux - this is usually the culprit when a problem seems really weird.
Any ideas or experience with this problem and what the solution might be?
Thanks
/var/log/cron? – larsks Aug 15 '12 at 16:16$ service crond status...crond (pid 28490) is running.... Also, the file perms are664, but since I can log in as apache myself and run the command manually this cannot be the issue. – Tom Aug 16 '12 at 19:45/var/log/cron– Tom Aug 16 '12 at 19:52