Bug 245750 - Automatic backup in moodle does not work
Automatic backup in moodle does not work
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: moodle (Show other bugs)
6
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jon Ciesla
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-26 09:55 EDT by Leopold Aichinger
Modified: 2009-03-09 18:55 EDT (History)
1 user (show)

See Also:
Fixed In Version: 1.9.4-3.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-06 13:58:12 EDT
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 Leopold Aichinger 2007-06-26 09:55:19 EDT
Description of problem:
The backup configuration page enables administrators to configure automated
course backups and a backup schedule. 
This does not work in moodle on Fedora
Core6 and I think this problem also exits in moodle1.8, coming with
FedoraCore7

Version-Release number of selected component (if applicable):
moodle-1.6.5-5.fc6

How reproducible:
Login in moodle as admin and go to the administration page.
Activate automatic backup for example from Monday to Friday

Steps to Reproduce:
1.Login in moodle as admin
2.Go to the administration page
3.go to backup
  
Actual results:
No backups are made

Expected results:


Additional info:
There is a cron-file in the directory /etc/cron.d under the name moodle
containing the following crontab-entry:
*/5 * * * * apache /usr/sbin/moodle-cron
This starts the shellscript /usr/sbin/moodle-cron every 5 minutes.

But the shell-script moodle-cron will not do anything because
it checks if the file /var/lock/subsys/moodle exits:
[ -f /var/lock/subsys/moodle ] && /usr/bin/php /var/www/moodle/web/admin/cron.php

This is never true on my system because moodle did not create
the file /var/lock/subsys/moodle (moodle is not a daemon)
[ -f /var/lock/subsys/httpd ] would make sense!
Comment 1 Jon Ciesla 2007-07-25 19:50:00 EDT
Check the 1.8.2-1 build in rawhide, it addresses this issue.
Comment 2 Fedora Update System 2007-08-06 13:58:07 EDT
moodle-1.8.2-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 3 junk 2009-02-21 21:49:36 EST
The problem with the cron file mentioned in "Additional info" in the original bug report is still there in moodle-1.9.4
Comment 4 Jon Ciesla 2009-02-23 08:56:01 EST
The current moodle-cron on all versions is the following:

#!/bin/sh

[ -f /var/lock/subsys/moodle ] && [ -f /var/lock/subsys/httpd ] && /usr/bin/php /var/www/moodle/web/admin/cron.php


Does this not work?
Comment 5 Jon Ciesla 2009-02-23 14:10:09 EST
Update coming for F-10 and F-9.
Comment 6 Leopold Aichinger 2009-02-24 02:27:31 EST
#!/bin/sh

[ -f /var/lock/subsys/moodle ] && [ -f /var/lock/subsys/httpd ] && /usr/bin/php
/var/www/moodle/web/admin/cron.php

This would not work, because moodle will not generate a file /var/lock/subsys/moodle (This is true for version 1.6.5-5.fc6, which I use)
Perhaps newer versions will? - but I don't think so, because moodle is not
a daemon and therefor not an independent process and will not be started through a
SystemV-Script.
(see: "Why do init scripts require lock files? by Bradford Hinson": http://www.redhat.com/magazine/008jun05/departments/tips_tricks/)

The file /var/lock/subsys/httpd will generated when httpd starts, and this file
will removed when httpd is stopped through the SystemV-Start/StopScript.

so
#!/bin/sh 

[ -f /var/lock/subsys/httpd ] && /usr/bin/php /var/www/moodle/web/admin/cron.php

will work!
Comment 7 Fedora Update System 2009-02-27 16:08:59 EST
moodle-1.9.4-3.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/moodle-1.9.4-3.fc10
Comment 8 Fedora Update System 2009-02-27 16:09:10 EST
moodle-1.9.4-3.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/moodle-1.9.4-3.fc9
Comment 9 Fedora Update System 2009-03-09 18:51:06 EDT
moodle-1.9.4-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 10 Fedora Update System 2009-03-09 18:55:09 EDT
moodle-1.9.4-3.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

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