Bug 468929 - disabled moodle cronjob runs every 5 minutes
Summary: disabled moodle cronjob runs every 5 minutes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: moodle
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-28 22:07 UTC by András Szilárd
Modified: 2009-04-04 04:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-20 19:15:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description András Szilárd 2008-10-28 22:07:05 UTC
Description of problem:
moodle cronjob sends mail to root (apache@localhost) every 5 minutes even if moodle was not started/enabled after install.

Example:
N 20 root  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
#!/bin/sh

[ -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

How reproducible:
Did not try to re-install...

Steps to Reproduce:
1.
2.
3.
  
Actual results:
moodle cron job seems to be executed even though it is "disabled" 

Expected results:
disabled cronjob should not overflow a mailbox?

Additional info:

Comment 1 Gwyn Ciesla 2008-10-29 13:31:59 UTC
Did your additional check work?  I suspect it did, but I'd like confirmation.

Comment 2 András Szilárd 2008-10-29 20:25:20 UTC
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.

Comment 3 Gwyn Ciesla 2008-10-30 12:36:10 UTC
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?

Comment 4 András Szilárd 2008-10-30 21:41:49 UTC
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.

Comment 5 Gwyn Ciesla 2008-10-31 12:59:10 UTC
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.

Comment 6 Fedora Update System 2008-10-31 15:11:15 UTC
moodle-1.9.3-2.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/moodle-1.9.3-2.fc9

Comment 7 Fedora Update System 2008-11-04 21:33:20 UTC
moodle-1.9.3-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/moodle-1.9.3-2.fc10

Comment 8 Fedora Update System 2008-11-06 04:06:52 UTC
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

Comment 9 Fedora Update System 2008-11-07 16:22:31 UTC
moodle-1.9.3-3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/moodle-1.9.3-3.fc10

Comment 10 Fedora Update System 2008-11-07 16:23:25 UTC
moodle-1.9.3-3.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/moodle-1.9.3-3.fc9

Comment 11 Fedora Update System 2008-11-07 18:20:47 UTC
moodle-1.8.7-1.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/moodle-1.8.7-1.fc8

Comment 12 Fedora Update System 2008-11-08 02:10:56 UTC
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.

Comment 13 Fedora Update System 2008-11-08 02:11:15 UTC
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.

Comment 14 Fedora Update System 2008-11-22 16:45:15 UTC
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.

Comment 15 Gwyn Ciesla 2009-01-20 19:15:15 UTC
Should be closed. Hrm.

Comment 16 Matthew West 2009-04-04 04:19:21 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.