Issue Details (XML | Word | Printable)

Key: MDL-6850
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Martin Dougiamas
Reporter: francisco
Votes: 2
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

du needs to be GNU du

Created: 05/Oct/06 11:25 PM   Updated: 19/Jul/08 12:23 AM
Return to search
Component/s: Administration
Affects Version/s: 1.8.2, 1.9
Fix Version/s: 1.6.8, 1.7.6, 1.8.7, 1.9.3

File Attachments: 1. File moodlelib.php.diff (0.9 kB)

Environment: Solaris 10, sparc64, Mac OS X Server

Participants: francisco, Howard Miller, Jeffrey Silverman, Ken Wilson, Martin Dougiamas and Nicolas Martignoni
Security Level: None
QA Assignee: Nicolas Martignoni
Resolved date: 18/Jul/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
In Administration >> Configuration >> Variables >> Operating System is an entry for pathtodu. This should specify that GNU du is needed since du is called with --apparent-size, a GNUism. Otherwise, the error logs will contain lines similar to:
/usr/bin/du: illegal option -- apparent-size
usage: du [-a] [-d] [-h|-k] [-r] [-o|-s] [-H|-L] [file ...]

The page in question is lang/en_utf8/admin.php

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Martignoni added a comment - 25/Apr/07 07:47 PM
Confirming. Still present on 1.8+. On our Mac OS X server, the logs are full of these lines

IMHO, we shouldn't rely on specialities of Un*x variants.


Nicolas Martignoni made changes - 25/Apr/07 07:48 PM
Field Original Value New Value
Environment Solaris 10, sparc64 Solaris 10, sparc64, Mac OS X Server
Martin Dougiamas added a comment - 26/Apr/07 03:39 PM
Does anyone have a better set of arguments to pass to du ?

Ken Wilson added a comment - 23/Aug/07 04:40 PM
I'm not sure of any better arguments for *nix systems, and changing the arguments may cause problems for admins/users as they may suddenly see a change in the file sizes as reported by the get_directory_size function.

In any case, the GNU Win32 version of du does not have the --apparent-size option, so it's a GNUism only for Linux systems. For Windows systems, this is the only version of du available and the --apparent-size option breaks get_directory_size. Whatever the reason was for the inclusion of this option, I've attached a diff to check for Windows OS so that du works.

I've moved this up to major as it's a biggie for Windows users who are struggling with directories full of gigabytes of course materials .


Ken Wilson made changes - 23/Aug/07 04:40 PM
Priority Minor [ 4 ] Major [ 3 ]
Ken Wilson made changes - 23/Aug/07 04:41 PM
Attachment moodlelib.php.diff [ 11711 ]
Ken Wilson made changes - 23/Aug/07 04:42 PM
Affects Version/s 1.9 [ 10190 ]
Affects Version/s 1.6.2 [ 10119 ]
Affects Version/s 1.8.2 [ 10220 ]
Nicolas Martignoni added a comment - 31/Dec/07 08:27 PM
See also this old discussion: http://moodle.org/mod/forum/discuss.php?d=30287

If this cannot be directly solved, suggesting the display of a warning.


Nicolas Martignoni made changes - 31/Dec/07 08:27 PM
Component/s Administration [ 10050 ]
QA Assignee mina
Affects Version/s 1.9.2 [ 10241 ]
Component/s Unknown [ 10120 ]
Affects Version/s 1.9 [ 10190 ]
Petr Skoda made changes - 03/Jan/08 08:04 PM
Affects Version/s 1.9 [ 10190 ]
Affects Version/s 1.9.2 [ 10241 ]
Jeffrey Silverman added a comment - 19/Jun/08 12:27 AM
Hi. Just weighing in with a "me too"

Running this thing ('thing" being Moodle on Solaris creates the same problem, as Solaris du does not have the --apparent_size option.

Not sure of a solution except to suggest that such system-specific code is not portable, but you all know that already.

Thanks!


Jeffrey Silverman added a comment - 19/Jun/08 12:28 AM
Oops, duh. The enviornment "Solaris" is already listed as part of the bug. Sorry! Still, would be nice to have this cleaned up.

Howard Miller added a comment - 18/Jul/08 02:23 PM
Another me too. Turned up on a pile of our sites using Solaris.

Martin Dougiamas made changes - 18/Jul/08 02:35 PM
Fix Version/s 1.6.8 [ 10293 ]
Fix Version/s 1.7.6 [ 10292 ]
Fix Version/s 1.8.7 [ 10291 ]
Fix Version/s 1.9.3 [ 10290 ]
moodler committed 1 file to 'Moodle CVS' on branch 'MOODLE_16_STABLE' - 18/Jul/08 02:36 PM
MDL-6850 Removed apparent-size from du command as it's not always available and appears to be useless anyway :-P
MODIFY lib/moodlelib.php   Rev. 1.705.6.8    (+3 -3 lines)
moodler committed 1 file to 'Moodle CVS' on branch 'MOODLE_17_STABLE' - 18/Jul/08 02:38 PM
MDL-6850 Removed apparent-size from du
MODIFY lib/moodlelib.php   Rev. 1.774.2.40    (+3 -3 lines)
moodler committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 18/Jul/08 02:40 PM
MDL-6850 Removed apparent-size from du
MODIFY lib/moodlelib.php   Rev. 1.837.2.87    (+3 -3 lines)
moodler committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 18/Jul/08 02:41 PM
MDL-6850 Removed apparent-size from du
MODIFY lib/moodlelib.php   Rev. 1.960.2.82    (+3 -3 lines)
moodler committed 1 file to 'Moodle CVS' - 18/Jul/08 02:42 PM
MDL-6850 Removed apparent-size from du
MODIFY lib/moodlelib.php   Rev. 1.1071    (+3 -3 lines)
Martin Dougiamas added a comment - 18/Jul/08 02:49 PM
OK, I've removed --apparent-size from everywhere. In some limited tests I did I could see no benefit in using it anyway!

Martin Dougiamas made changes - 18/Jul/08 02:49 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Nicolas Martignoni added a comment - 19/Jul/08 12:23 AM
Closing, verified.

Nicolas Martignoni made changes - 19/Jul/08 12:23 AM
Status Resolved [ 5 ] Closed [ 6 ]