Bug 468929 - disabled moodle cronjob runs every 5 minutes
disabled moodle cronjob runs every 5 minutes
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: moodle (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Gwyn Ciesla
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-28 18:07 EDT by András Szilárd
Modified: 2009-04-04 00:19 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 14:15:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description András Szilárd 2008-10-28 18:07:05 EDT
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@localhost.local  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 09:31:59 EDT
Did your additional check work?  I suspect it did, but I'd like confirmation.
Comment 2 András Szilárd 2008-10-29 16:25:20 EDT
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 08:36:10 EDT
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 17:41:49 EDT
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 08:59:10 EDT
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 11:11:15 EDT
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 16:33:20 EST
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-05 23:06:52 EST
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 11:22:31 EST
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 11:23:25 EST
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 13:20:47 EST
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-07 21:10:56 EST
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-07 21:11:15 EST
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 11:45:15 EST
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 14:15:15 EST
Should be closed. Hrm.
Comment 16 Matthew West 2009-04-04 00:19:21 EDT
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.