Merge from Subversion r50.
[ira/wip.git] / docs / docbook / smbdotconf / misc / dfreecommand.xml
1 <samba:parameter xmlns:samba="http://samba.org/common">
2                 <term><anchor id="DFREECOMMAND"/>dfree command (G)</term>
3                 <listitem><para>The <parameter moreinfo="none">dfree command</parameter> setting should 
4                 only be used on systems where a problem occurs with the internal 
5                 disk space calculations. This has been known to happen with Ultrix, 
6                 but may occur with other operating systems. The symptom that was 
7                 seen was an error of &quot;Abort Retry Ignore&quot; at the end of each 
8                 directory listing.</para>
9                 
10                 <para>This setting allows the replacement of the internal routines to
11                 calculate the total disk space and amount available with an external
12                 routine. The example below gives a possible script that might fulfill
13                 this function.</para>
14
15                 <para>The external program will be passed a single parameter indicating 
16                 a directory in the filesystem being queried. This will typically consist
17                 of the string <filename moreinfo="none">./</filename>. The script should return two 
18                 integers in ASCII. The first should be the total disk space in blocks, 
19                 and the second should be the number of available blocks. An optional 
20                 third return value can give the block size in bytes. The default 
21                 blocksize is 1024 bytes.</para>
22
23                 <para>Note: Your script should <emphasis>NOT</emphasis> be setuid or 
24                 setgid and should be owned by (and writeable only by) root!</para>
25
26                 <para>Default: <emphasis>By default internal routines for 
27                 determining the disk capacity and remaining space will be used.
28                 </emphasis></para>
29
30                 <para>Example: <command moreinfo="none">dfree command = /usr/local/samba/bin/dfree
31                 </command></para>
32
33                 <para>Where the script dfree (which must be made executable) could be:</para>
34
35 <para><programlisting format="linespecific"> 
36 #!/bin/sh
37 df $1 | tail -1 | awk '{print $2&quot; &quot;$4}'
38 </programlisting></para>
39
40                 <para>or perhaps (on Sys V based systems):</para>
41
42 <para><programlisting format="linespecific"> 
43 #!/bin/sh
44 /usr/bin/df -k $1 | tail -1 | awk '{print $3&quot; &quot;$5}'
45 </programlisting></para>
46                 
47                 <para>Note that you may have to replace the command names 
48                 with full path names on some systems.</para>
49                 </listitem>
50                 </samba:parameter>