Bug 245750 - Automatic backup in moodle does not work
Summary: Automatic backup in moodle does not work
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: moodle
Version: 6
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-26 13:55 UTC by Leopold Aichinger
Modified: 2009-03-09 22:55 UTC (History)
1 user (show)

Fixed In Version: 1.9.4-3.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-06 17:58:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Leopold Aichinger 2007-06-26 13:55:19 UTC
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 Gwyn Ciesla 2007-07-25 23:50:00 UTC
Check the 1.8.2-1 build in rawhide, it addresses this issue.

Comment 2 Fedora Update System 2007-08-06 17:58:07 UTC
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-22 02:49:36 UTC
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 Gwyn Ciesla 2009-02-23 13:56:01 UTC
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 Gwyn Ciesla 2009-02-23 19:10:09 UTC
Update coming for F-10 and F-9.

Comment 6 Leopold Aichinger 2009-02-24 07:27:31 UTC
#!/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 21:08:59 UTC
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 21:09:10 UTC
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 22:51:06 UTC
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 22:55:09 UTC
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.