Red Hat Bugzilla – Bug 468929
disabled moodle cronjob runs every 5 minutes
Last modified: 2009-04-04 00:19:21 EDT
Description of problem:
moodle cronjob sends mail to root (apache@localhost) every 5 minutes even if moodle was not started/enabled after install.
N 20 email@example.com Tue Oct 28 22:35 25/1621 "Cron <apache@localhost> /usr/sbin/moodle-cron"
The relevant content: "The site administrator should also check that the database details have been correctly specified in config.php" and "ADODB Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
[root@localhost ~]# /etc/init.d/moodle status
Moodle cron job is disabled.
[root@localhost ~]# cat /etc/cron.d/moodle
*/5 * * * * apache /usr/sbin/moodle-cron
Version-Release number of selected component (if applicable):
[root@localhost ~]# rpm -qif /usr/sbin/moodle-cron
Name : moodle Relocations: (not relocatable)
Version : 1.9.1 Vendor: Fedora Project
Release : 2.fc9 Build Date: Mon 23 Jun 2008 05:59:11 PM CEST
Install Date: Fri 24 Oct 2008 04:36:00 PM CEST Build Host: x86-6
Group : Applications/Publishing Source RPM: moodle-1.9.1-2.fc9.src.rpm
Size : 40369323 License: GPLv2+
Signature : DSA/SHA1, Thu 28 Aug 2008 11:55:43 PM CEST, Key ID 62aec3dc6df2196f
Probably an additional check is missing from moodle-cron?
[root@localhost ~]# cat /usr/sbin/moodle-cron
[ -f /var/lock/subsys/httpd ] && /usr/bin/php /var/www/moodle/web/admin/cron.php
--- should be???
[ -f /var/lock/subsys/moodle ] && [ -f /var/lock/subsys/httpd ] && /usr/bin/php /var/www/moodle/web/admin/cron.php
Did not try to re-install...
Steps to Reproduce:
moodle cron job seems to be executed even though it is "disabled"
disabled cronjob should not overflow a mailbox?
Did your additional check work? I suspect it did, but I'd like confirmation.
Yes, it works, but it seems to be a quick-fix only.
I guess, /etc/cron.d/moodle should not be present, when the service is disabled.
Seems like the most sensible solution to me. Otherwise, we have to have the initscript remove and replace the cron file, which seem cumbersome to me. Would that be your preference?
Yes, but I am not sure what is the general solution (if there is such).
My opinion is that system-wide it is not good to populate the cron directory unnecessarily.
I'm not aware of anything else, so I'll use this for now. If you come up with a better idea, I'll be happy to look at it later.
moodle-1.9.3-2.fc9 has been submitted as an update for Fedora 9.
moodle-1.9.3-2.fc10 has been submitted as an update for Fedora 10.
moodle-1.9.3-2.fc9 has been pushed to the Fedora 9 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update moodle'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-9373
moodle-1.9.3-3.fc10 has been submitted as an update for Fedora 10.
moodle-1.9.3-3.fc9 has been submitted as an update for Fedora 9.
moodle-1.8.7-1.fc8 has been submitted as an update for Fedora 8.
moodle-1.8.7-1.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.
moodle-1.9.3-3.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
moodle-1.9.3-3.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
Should be closed. Hrm.
This problem is still present as far as I can tell in Fedora 10 with moodle-1.9.4-3.fc10 so somehow the bugfix got lost. That is, in F10 at present the file /usr/sbin/moodle-cron has only the test for /var/lock/subsys/httpd and not that for /var/lock/subsys/moodle.