~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to docs-xml/using_samba/ch08.xml

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<chapter label="8" id="SAMBA-CH-8">
 
2
<title>Additional Samba Information </title>
 
3
 
 
4
 
 
5
 
 
6
 
 
7
<para>This chapter wraps up our coverage of the <filename>smb.conf</filename> configuration file with some miscellaneous options that can perform a variety of tasks. We will talk briefly about options for supporting programmers, internationalization, messages, and common Windows bugs. For the most part, you will use these options only in isolated circumstances. We also cover performing automated backups with the <filename>smbtar</filename> command at the end of this chapter. So without further ado, let's jump into our first subject: options to help programmers.</para>
 
8
 
 
9
 
 
10
 
 
11
 
 
12
 
 
13
 
 
14
 
 
15
 
 
16
 
 
17
 
 
18
 
 
19
<sect1 role="" label="8.1" id="ch08-56646">
 
20
<title>Supporting Programmers</title>
 
21
 
 
22
 
 
23
<para>
 
24
<indexterm id="ch08-idx-965254-0" class="startofrange"><primary>programmers, support for</primary></indexterm>If <indexterm id="ch08-idx-965351-0" class="startofrange"><primary>smb.conf (Samba configuration) file</primary><secondary>options for</secondary><tertiary>supporting programmers</tertiary></indexterm>you have programmers accessing your Samba server, you'll want to be aware of the special options listed in <link linkend="ch08-73167">Table 8.1</link>.</para>
 
25
 
 
26
 
 
27
<table label="8.1" id="ch08-73167">
 
28
<title>Programming Configuration Options </title>
 
29
 
 
30
<tgroup cols="5">
 
31
<colspec colnum="1" colname="col1"/>
 
32
<colspec colnum="2" colname="col2"/>
 
33
<colspec colnum="3" colname="col3"/>
 
34
<colspec colnum="4" colname="col4"/>
 
35
<colspec colnum="5" colname="col5"/>
 
36
<thead>
 
37
<row>
 
38
 
 
39
<entry colname="col1"><para>Option</para></entry>
 
40
 
 
41
<entry colname="col2"><para>Parameters</para></entry>
 
42
 
 
43
<entry colname="col3"><para>Function</para></entry>
 
44
 
 
45
<entry colname="col4"><para>Default</para></entry>
 
46
 
 
47
<entry colname="col5"><para>Scope</para></entry>
 
48
 
 
49
</row>
 
50
 
 
51
</thead>
 
52
 
 
53
<tbody>
 
54
<row>
 
55
 
 
56
<entry colname="col1"><para><literal>time server</literal></para></entry>
 
57
 
 
58
<entry colname="col2"><para>boolean</para></entry>
 
59
 
 
60
<entry colname="col3"><para>If <literal>yes</literal>, <emphasis>nmbd</emphasis> announces itself as a SMB time service to Windows clients.</para></entry>
 
61
 
 
62
<entry colname="col4"><para><literal>no</literal></para></entry>
 
63
 
 
64
<entry colname="col5"><para>Global</para></entry>
 
65
 
 
66
</row>
 
67
 
 
68
<row>
 
69
 
 
70
<entry colname="col1"><para><literal>time offset</literal></para></entry>
 
71
 
 
72
<entry colname="col2"><para>numerical (number of minutes)</para></entry>
 
73
 
 
74
<entry colname="col3"><para>Adds a specified number of minutes to the reported time.</para></entry>
 
75
 
 
76
<entry colname="col4"><para><literal>0</literal></para></entry>
 
77
 
 
78
<entry colname="col5"><para>Global</para></entry>
 
79
 
 
80
</row>
 
81
 
 
82
<row>
 
83
 
 
84
<entry colname="col1"><para><literal>dos filetimes</literal></para></entry>
 
85
 
 
86
<entry colname="col2"><para>boolean</para></entry>
 
87
 
 
88
<entry colname="col3"><para>Allows non-owners of a file to change its time if they can write to it.</para></entry>
 
89
 
 
90
<entry colname="col4"><para><literal>no</literal></para></entry>
 
91
 
 
92
<entry colname="col5"><para>Share</para></entry>
 
93
 
 
94
</row>
 
95
 
 
96
<row>
 
97
 
 
98
<entry colname="col1"><para><literal>dos filetime</literal></para>
 
99
 
 
100
<para><literal>resolution</literal></para></entry>
 
101
 
 
102
<entry colname="col2"><para>boolean</para></entry>
 
103
 
 
104
<entry colname="col3"><para>Causes file times to be rounded to the next even second.</para></entry>
 
105
 
 
106
<entry colname="col4"><para><literal>no</literal></para></entry>
 
107
 
 
108
<entry colname="col5"><para>Share</para></entry>
 
109
 
 
110
</row>
 
111
 
 
112
<row>
 
113
 
 
114
<entry colname="col1"><para><literal>fake directory create times</literal></para></entry>
 
115
 
 
116
<entry colname="col2"><para>boolean</para></entry>
 
117
 
 
118
<entry colname="col3"><para>Sets directory times to avoid a MS <emphasis>nmake</emphasis> bug.</para></entry>
 
119
 
 
120
<entry colname="col4"><para><literal>no</literal></para></entry>
 
121
 
 
122
<entry colname="col5"><para>Share</para></entry>
 
123
 
 
124
</row>
 
125
 
 
126
</tbody>
 
127
</tgroup>
 
128
</table>
 
129
 
 
130
 
 
131
<sect2 role="" label="8.1.1" id="ch08-SECT-1.1">
 
132
<title>Time Synchronization</title>
 
133
 
 
134
 
 
135
<para>
 
136
<indexterm id="ch08-idx-965360-0"><primary>synchronizing</primary><secondary>time, options for</secondary></indexterm>
 
137
<indexterm id="ch08-idx-965360-1"><primary>time snychronization, options for</primary></indexterm>Time synchronization can be very important to programmers. Consider the following options:</para>
 
138
 
 
139
 
 
140
<programlisting>time service = yes
 
141
dos filetimes = yes
 
142
fake directory create times = yes
 
143
dos filetime resolution = yes
 
144
delete readonly = yes</programlisting>
 
145
 
 
146
 
 
147
<para>If you set these options, Samba shares will provide the kind of compatible file times that Visual C++, <emphasis>nmake</emphasis>, and other Microsoft programming tools require. Otherwise, PC <emphasis>make</emphasis> programs will tend to think that all the files in a directory need to be recompiled every time. Obviously, this is not the behavior you want.</para>
 
148
 
 
149
 
 
150
<sect3 role="" label="8.1.1.1" id="ch08-SECT-1.1.1">
 
151
<title>time server</title>
 
152
 
 
153
 
 
154
<para>If your Samba server has an accurate clock, or if it's a client of one of the Unix network time servers, you can instruct it to advertise itself as an SMB time server by setting the<indexterm id="ch08-idx-965946-0"><primary>time server option</primary></indexterm> <literal>time</literal> <literal>server</literal> option as follows:</para>
 
155
 
 
156
 
 
157
<programlisting>[global]
 
158
        time service = yes</programlisting>
 
159
 
 
160
 
 
161
<para>The client will still have to request the correct time with the following DOS command, substituting the Samba server name in at the appropriate point:</para>
 
162
 
 
163
 
 
164
<programlisting>C:\NET TIME \\<replaceable>server</replaceable> /YES /SET</programlisting>
 
165
 
 
166
 
 
167
<para>This command can be placed in a Windows logon script (see <link linkend="SAMBA-CH-6">Chapter 6</link>).</para>
 
168
 
 
169
 
 
170
<para>By default, the <literal>time</literal> <literal>server</literal> option is normally set to <literal>no</literal>. If you turn this service on, you can use the command above to keep the client clocks from drifting. Time synchronization is important to clients using programs such as <emphasis>make</emphasis>, which compile based on the last time the file was changed. Incorrectly synchronized times can cause such programs to either remake all files in a directory, which wastes time, or not recompile a source file that was just modified because of a slight clock drift.</para>
 
171
</sect3>
 
172
 
 
173
 
 
174
 
 
175
<sect3 role="" label="8.1.1.2" id="ch08-SECT-1.1.2">
 
176
<title>time offset</title>
 
177
 
 
178
 
 
179
<para>To deal with clients that don't process daylight savings time properly, Samba provides the <literal>time</literal> <literal>offset</literal> option. If set, it adds the specified number of minutes to the current time. This is handy if you're in Newfoundland and Windows doesn't know about the 30-minute time difference there:</para>
 
180
 
 
181
 
 
182
<programlisting>[global]
 
183
        time offset = 30</programlisting>
 
184
</sect3>
 
185
 
 
186
 
 
187
 
 
188
<sect3 role="" label="8.1.1.3" id="ch08-SECT-1.1.3">
 
189
<title>dos filetimes</title>
 
190
 
 
191
 
 
192
<para>Traditionally, only the root user and the owner of a file can change its last-modified date on a Unix system. The share-level <literal>dos</literal> <literal>filetimes</literal> option allows the Samba server to mimic the characteristics of a DOS/Windows machine: any user can change the last modified date on a file in that share if he or she has write permission to it. In order to do this, Samba uses its root privileges to modify the timestamp on the file.</para>
 
193
 
 
194
 
 
195
<para>By default, this option is disabled. Setting this option to <literal>yes</literal> is often necessary to allow PC <emphasis>make</emphasis> programs to work properly. Without it, they cannot change the last-modified date themselves. This often results in the program thinking <emphasis>all</emphasis> files need recompiling when they really don't.</para>
 
196
</sect3>
 
197
 
 
198
 
 
199
 
 
200
<sect3 role="" label="8.1.1.4" id="ch08-SECT-1.1.4">
 
201
<title>dos filetime resolution</title>
 
202
 
 
203
 
 
204
<para><literal>dos</literal>
 
205
<indexterm id="ch08-idx-965949-0"><primary>os filetime resolution option</primary></indexterm> <literal>filetime</literal> <literal>resolution</literal> is share-level option. If set to <literal>yes</literal>, Samba will arrange to have the file times rounded to the closest two-second boundary. This option exists primarily to satisfy a quirk in Windows that prevents Visual C++ from correctly recognizing that a file has not changed. You can enable it as follows:</para>
 
206
 
 
207
 
 
208
<programlisting>[data]
 
209
        dos filetime resolution = yes</programlisting>
 
210
 
 
211
 
 
212
<para>We recommend using this option only if you are using Microsoft Visual C++ on a Samba share that supports opportunistic locking.</para>
 
213
</sect3>
 
214
 
 
215
 
 
216
 
 
217
<sect3 role="" label="8.1.1.5" id="ch08-SECT-1.1.5">
 
218
<title>fake directory create times</title>
 
219
 
 
220
 
 
221
<para>The <literal>fake</literal>
 
222
<indexterm id="ch08-idx-965950-0"><primary>fake directory create times option</primary></indexterm> <literal>directory</literal> <literal>create</literal> <literal>times</literal> option exists to keep PC <emphasis>make</emphasis> programs sane. VFAT and NTFS filesystems record the creation date of a specific directory while Unix does not. Without this option, Samba takes the earliest recorded date it has for the directory (often the last-modified date of a file) and returns it to the client. If this is not sufficient, set the following option under a share definition:</para>
 
223
 
 
224
 
 
225
<programlisting>[data]
 
226
        fake directory create times = yes</programlisting>
 
227
 
 
228
 
 
229
<para>If set, Samba will adjust the directory create time it reports to the hardcoded value January 1st, 1980. This is primarily used to convince the Visual C++ <emphasis>nmake</emphasis> program that any object files in its build directories are indeed younger than the creation date of the directory itself and need to be recompiled.<indexterm id="ch08-idx-965924-0" class="endofrange" startref="ch08-idx-965351-0"/></para>
 
230
</sect3>
 
231
</sect2>
 
232
</sect1>
 
233
 
 
234
 
 
235
 
 
236
 
 
237
 
 
238
 
 
239
 
 
240
 
 
241
 
 
242
<sect1 role="" label="8.2" id="ch08-79987">
 
243
<title>Magic Scripts</title>
 
244
 
 
245
 
 
246
<para>
 
247
<indexterm id="ch08-idx-965216-0"><primary>magic scripts</primary></indexterm>
 
248
<indexterm id="ch08-idx-965216-1"><primary>scripts</primary><secondary>magic</secondary></indexterm>The following options deal with <firstterm>magic scripts</firstterm> on the Samba server. Magic scripts are a method of running programs on Unix and redirecting the output back to the <indexterm id="ch08-idx-965385-0"><primary>SMB (Server Message Block)</primary><secondary>magic scripts</secondary></indexterm>SMB client. These are essentially an experimental hack. However, some users and their programs still rely on these two options for their programs to function correctly. Magic scripts are not widely trusted and their use is highly discouraged by the Samba team. See <link linkend="ch08-33693">Table 8.2</link> for more information.</para>
 
249
 
 
250
 
 
251
<table label="8.2" id="ch08-33693">
 
252
<title>Networking Configuration Options </title>
 
253
 
 
254
<tgroup cols="5">
 
255
<colspec colnum="1" colname="col1"/>
 
256
<colspec colnum="2" colname="col2"/>
 
257
<colspec colnum="3" colname="col3"/>
 
258
<colspec colnum="4" colname="col4"/>
 
259
<colspec colnum="5" colname="col5"/>
 
260
<thead>
 
261
<row>
 
262
 
 
263
<entry colname="col1"><para>Option</para></entry>
 
264
 
 
265
<entry colname="col2"><para>Parameters</para></entry>
 
266
 
 
267
<entry colname="col3"><para>Function</para></entry>
 
268
 
 
269
<entry colname="col4"><para>Default</para></entry>
 
270
 
 
271
<entry colname="col5"><para>Scope</para></entry>
 
272
 
 
273
</row>
 
274
 
 
275
</thead>
 
276
 
 
277
<tbody>
 
278
<row>
 
279
 
 
280
<entry colname="col1"><para><literal>magic script</literal></para></entry>
 
281
 
 
282
<entry colname="col2"><para>
 
283
<indexterm id="ch08-idx-965386-0"><primary>networking</primary><secondary>options</secondary><tertiary>magic script</tertiary></indexterm>string (fully-qualified filename)</para></entry>
 
284
 
 
285
<entry colname="col3"><para>Sets the name of a file to be executed by Samba, as the logged-on user, when closed.</para></entry>
 
286
 
 
287
<entry colname="col4"><para>None</para></entry>
 
288
 
 
289
<entry colname="col5"><para>Share</para></entry>
 
290
 
 
291
</row>
 
292
 
 
293
<row>
 
294
 
 
295
<entry colname="col1"><para><literal>magic output</literal></para></entry>
 
296
 
 
297
<entry colname="col2"><para>string (fully-qualified filename)</para></entry>
 
298
 
 
299
<entry colname="col3"><para>Sets a file to log output from the magic file.</para></entry>
 
300
 
 
301
<entry colname="col4"><para><emphasis>scriptname.out</emphasis></para></entry>
 
302
 
 
303
<entry colname="col5"><para>Share</para></entry>
 
304
 
 
305
</row>
 
306
 
 
307
</tbody>
 
308
</tgroup>
 
309
</table>
 
310
 
 
311
 
 
312
<sect2 role="" label="8.2.1" id="ch08-SECT-2.0.1">
 
313
<title>magic script</title>
 
314
 
 
315
 
 
316
<para>If the <literal>magic</literal>
 
317
<indexterm id="ch08-idx-965952-0"><primary>magic script option</primary></indexterm> <literal>script</literal> option is set to a filename and the client creates a file by that name in that share, Samba will run the file as soon as the user has opened and closed it. For example, let's assume that the following option was created in the share <literal>[accounting]</literal>:</para>
 
318
 
 
319
 
 
320
<programlisting>[accounting]
 
321
        magic script = tally.sh</programlisting>
 
322
 
 
323
 
 
324
<para>Samba continually monitors the files in that share. If one by the name of <emphasis>tally.sh</emphasis> is closed (after being opened) by a user, Samba will execute the contents of that file locally. The file will be passed to the shell to execute; it must therefore be a legal Unix shell script. This means that it must have newline characters as line endings instead of Windows CR/LFs. In addition, it helps if you use the <literal>#!</literal> directive at the beginning of the file to indicate under which shell the script should run.</para>
 
325
</sect2>
 
326
 
 
327
 
 
328
 
 
329
 
 
330
 
 
331
<sect2 role="" label="8.2.2" id="ch08-SECT-2.0.2">
 
332
<indexterm id="ch08-idx-965953-0"><primary>magic output option</primary></indexterm>
 
333
<title>
 
334
magic output</title>
 
335
 
 
336
 
 
337
<para>This option specifies an output file that the script specified by the <literal>magic</literal> <literal>script</literal> option will send output to. You must specify a filename in a writable directory:</para>
 
338
 
 
339
 
 
340
<programlisting>[accounting]
 
341
        magic script = tally.sh
 
342
        magic output = /var/log/magicoutput</programlisting>
 
343
 
 
344
 
 
345
<para>If this option is omitted, the default output file is the name of the script (as stated in the <literal>magic</literal> <literal>script</literal> option) with the extension <emphasis>.out</emphasis> appended onto it.<indexterm id="ch08-idx-965526-0" class="endofrange" startref="ch08-idx-965254-0"/></para>
 
346
</sect2>
 
347
</sect1>
 
348
 
 
349
 
 
350
 
 
351
 
 
352
 
 
353
 
 
354
 
 
355
 
 
356
 
 
357
<sect1 role="" label="8.3" id="ch08-91233">
 
358
<title>Internationalization</title>
 
359
 
 
360
 
 
361
<para>
 
362
<indexterm id="ch08-idx-965219-0" class="startofrange"><primary>internationalization</primary></indexterm>
 
363
<indexterm id="ch08-idx-965219-1" class="startofrange"><primary>foreign-language characters</primary></indexterm>
 
364
<indexterm id="ch08-idx-965219-2" class="startofrange"><primary>localization</primary></indexterm>Samba has a limited ability to speak foreign tongues: if you need to deal with characters that aren't in standard ASCII, some options that can help you are shown in <link linkend="ch08-40870">Table 8.3</link>. Otherwise, you can skip over this section.</para>
 
365
 
 
366
 
 
367
<table label="8.3" id="ch08-40870">
 
368
<title>Networking Configuration Options </title>
 
369
 
 
370
<tgroup cols="5">
 
371
<colspec colnum="1" colname="col1"/>
 
372
<colspec colnum="2" colname="col2"/>
 
373
<colspec colnum="3" colname="col3"/>
 
374
<colspec colnum="4" colname="col4"/>
 
375
<colspec colnum="5" colname="col5"/>
 
376
<thead>
 
377
<row>
 
378
 
 
379
<entry colname="col1"><para>Option</para></entry>
 
380
 
 
381
<entry colname="col2"><para>Parameters</para></entry>
 
382
 
 
383
<entry colname="col3"><para>Function</para></entry>
 
384
 
 
385
<entry colname="col4"><para>Default</para></entry>
 
386
 
 
387
<entry colname="col5"><para>Scope</para></entry>
 
388
 
 
389
</row>
 
390
 
 
391
</thead>
 
392
 
 
393
<tbody>
 
394
<row>
 
395
 
 
396
<entry colname="col1"><para><literal>client code page</literal></para></entry>
 
397
 
 
398
<entry colname="col2"><para>Described in this section</para></entry>
 
399
 
 
400
<entry colname="col3"><para>Sets a code page to expect from clients</para></entry>
 
401
 
 
402
<entry colname="col4"><para>850</para></entry>
 
403
 
 
404
<entry colname="col5"><para>Global</para></entry>
 
405
 
 
406
</row>
 
407
 
 
408
<row>
 
409
 
 
410
<entry colname="col1"><para><literal>character set</literal></para></entry>
 
411
 
 
412
<entry colname="col2"><para>Described in this section</para></entry>
 
413
 
 
414
<entry colname="col3"><para>Translates code pages into alternate UNIX character sets</para></entry>
 
415
 
 
416
<entry colname="col4"><para>None</para></entry>
 
417
 
 
418
<entry colname="col5"><para>Global</para></entry>
 
419
 
 
420
</row>
 
421
 
 
422
<row>
 
423
 
 
424
<entry colname="col1"><para><literal>coding system</literal></para></entry>
 
425
 
 
426
<entry colname="col2"><para>Described in this section</para></entry>
 
427
 
 
428
<entry colname="col3"><para>Translates code page 932 into an Asian character set</para></entry>
 
429
 
 
430
<entry colname="col4"><para>None</para></entry>
 
431
 
 
432
<entry colname="col5"><para>Global</para></entry>
 
433
 
 
434
</row>
 
435
 
 
436
<row>
 
437
 
 
438
<entry colname="col1"><para><literal>valid chars</literal></para></entry>
 
439
 
 
440
<entry colname="col2"><para>string (set of characters)</para></entry>
 
441
 
 
442
<entry colname="col3"><para>Obsolete: formerly added individual characters to a code page, and had to be used after setting client code page</para></entry>
 
443
 
 
444
<entry colname="col4"><para>None</para></entry>
 
445
 
 
446
<entry colname="col5"><para>Global</para></entry>
 
447
 
 
448
</row>
 
449
 
 
450
</tbody>
 
451
</tgroup>
 
452
</table>
 
453
 
 
454
 
 
455
<sect2 role="" label="8.3.1" id="ch08-17721">
 
456
<indexterm id="ch08-idx-965956-0"><primary>client code page option</primary></indexterm>
 
457
<title>
 
458
client code page</title>
 
459
 
 
460
 
 
461
<para>The character sets on Windows platforms hark back to the original concept of a <emphasis>code page</emphasis>
 
462
<indexterm id="ch08-idx-965388-0"><primary>code pages</primary></indexterm>. These code pages are used by DOS and Windows clients to determine rules for mapping lowercase letters to uppercase letters. Samba can be instructed to use a variety of code pages through the use of the global <literal>client</literal> <literal>code</literal> <literal>page</literal> option in order to match the corresponding code page in use on the client. This option loads a code-page definition file, and can take the values specified in <link linkend="ch08-20815">Table 8.4</link>.</para>
 
463
 
 
464
 
 
465
<table label="8.4" id="ch08-20815">
 
466
<title>Valid Code Pages with Samba 2.0 </title>
 
467
 
 
468
<tgroup cols="2">
 
469
<colspec colnum="1" colname="col1"/>
 
470
<colspec colnum="2" colname="col2"/>
 
471
<thead>
 
472
<row>
 
473
 
 
474
<entry colname="col1"><para>Code Page</para></entry>
 
475
 
 
476
<entry colname="col2"><para>Definition</para></entry>
 
477
 
 
478
</row>
 
479
 
 
480
</thead>
 
481
 
 
482
<tbody>
 
483
<row>
 
484
 
 
485
<entry colname="col1"><para><literal>437</literal></para></entry>
 
486
 
 
487
<entry colname="col2"><para>
 
488
<indexterm id="ch08-idx-965389-0"><primary>Samba</primary><secondary>version 2.0</secondary><tertiary>code pages for</tertiary></indexterm>MS-DOS Latin (United States)</para></entry>
 
489
 
 
490
</row>
 
491
 
 
492
<row>
 
493
 
 
494
<entry colname="col1"><para><literal>737</literal></para></entry>
 
495
 
 
496
<entry colname="col2"><para>Windows 95 Greek</para></entry>
 
497
 
 
498
</row>
 
499
 
 
500
<row>
 
501
 
 
502
<entry colname="col1"><para><literal>850</literal></para></entry>
 
503
 
 
504
<entry colname="col2"><para>MS-DOS Latin 1 (Western European)</para></entry>
 
505
 
 
506
</row>
 
507
 
 
508
<row>
 
509
 
 
510
<entry colname="col1"><para><literal>852</literal></para></entry>
 
511
 
 
512
<entry colname="col2"><para>MS-DOS Latin 2 (Eastern European)</para></entry>
 
513
 
 
514
</row>
 
515
 
 
516
<row>
 
517
 
 
518
<entry colname="col1"><para><literal>861</literal></para></entry>
 
519
 
 
520
<entry colname="col2"><para>MS-DOS Icelandic</para></entry>
 
521
 
 
522
</row>
 
523
 
 
524
<row>
 
525
 
 
526
<entry colname="col1"><para><literal>866</literal></para></entry>
 
527
 
 
528
<entry colname="col2"><para>MS-DOS Cyrillic (Russian)</para></entry>
 
529
 
 
530
</row>
 
531
 
 
532
<row>
 
533
 
 
534
<entry colname="col1"><para><literal>932</literal></para></entry>
 
535
 
 
536
<entry colname="col2"><para>MS-DOS Japanese Shift-JIS</para></entry>
 
537
 
 
538
</row>
 
539
 
 
540
<row>
 
541
 
 
542
<entry colname="col1"><para><literal>936</literal></para></entry>
 
543
 
 
544
<entry colname="col2"><para>MS-DOS Simplified Chinese</para></entry>
 
545
 
 
546
</row>
 
547
 
 
548
<row>
 
549
 
 
550
<entry colname="col1"><para><literal>949</literal></para></entry>
 
551
 
 
552
<entry colname="col2"><para>MS-DOS Korean Hangul</para></entry>
 
553
 
 
554
</row>
 
555
 
 
556
<row>
 
557
 
 
558
<entry colname="col1"><para><literal>950</literal></para></entry>
 
559
 
 
560
<entry colname="col2"><para>MS-DOS Traditional Chinese</para></entry>
 
561
 
 
562
</row>
 
563
 
 
564
</tbody>
 
565
</tgroup>
 
566
</table>
 
567
 
 
568
 
 
569
<para>You can set the client code page as follows:</para>
 
570
 
 
571
 
 
572
<programlisting>[global]
 
573
        client code page = 852</programlisting>
 
574
 
 
575
 
 
576
<para>The default value of this option is 850. You can use the <emphasis>make_smbcodepage</emphasis> tool that comes with Samba (by default in <filename>/usr/local/samba/bin</filename> ) to create your own SMB code pages, in the event that those listed earlier are not sufficient.</para>
 
577
</sect2>
 
578
 
 
579
 
 
580
 
 
581
 
 
582
 
 
583
<sect2 role="" label="8.3.2" id="ch08-SECT-3.0.2">
 
584
<title>character set</title>
 
585
 
 
586
 
 
587
<para>The global <literal>character</literal> <literal>set</literal> option can be used to convert filenames offered through a DOS code page (see the previous section, <link linkend="ch08-17721">Section 8.3.1</link>) to equivalents that can be represented by Unix character sets other than those in the United States. For example, if you want to convert the Western European MS-DOS character set on the client to a Western European Unix character set on the server, you can use the following in your configuration file:</para>
 
588
 
 
589
 
 
590
<programlisting>[global]
 
591
        client code page = 850
 
592
        character set = ISO8859-1</programlisting>
 
593
 
 
594
 
 
595
<para>Note that you must include a <literal>client</literal> <literal>code</literal> <literal>page</literal> option to specify the character set from which you are converting. The valid character sets (and their matching code pages) that Samba 2.0 accepts are listed in <link linkend="ch08-14126">Table 8.5</link>:</para>
 
596
 
 
597
 
 
598
<table label="8.5" id="ch08-14126">
 
599
<title>Valid Character Sets with Samba 2.0 </title>
 
600
 
 
601
<tgroup cols="3">
 
602
<colspec colnum="1" colname="col1"/>
 
603
<colspec colnum="2" colname="col2"/>
 
604
<colspec colnum="3" colname="col3"/>
 
605
<thead>
 
606
<row>
 
607
 
 
608
<entry colname="col1"><para>Character Set</para></entry>
 
609
 
 
610
<entry colname="col2"><para>Matching Code Page</para></entry>
 
611
 
 
612
<entry colname="col3"><para>Definition</para></entry>
 
613
 
 
614
</row>
 
615
 
 
616
</thead>
 
617
 
 
618
<tbody>
 
619
<row>
 
620
 
 
621
<entry colname="col1"><para><literal>ISO8859-1</literal></para></entry>
 
622
 
 
623
<entry colname="col2"><para><literal>850</literal>
 
624
<indexterm id="ch08-idx-965390-0"><primary>Samba</primary><secondary>version 2.0</secondary><tertiary>character sets</tertiary></indexterm></para></entry>
 
625
 
 
626
<entry colname="col3"><para>Western European Unix</para></entry>
 
627
 
 
628
</row>
 
629
 
 
630
<row>
 
631
 
 
632
<entry colname="col1"><para><literal>ISO8859-2</literal></para></entry>
 
633
 
 
634
<entry colname="col2"><para><literal>852</literal></para></entry>
 
635
 
 
636
<entry colname="col3"><para>Eastern European Unix</para></entry>
 
637
 
 
638
</row>
 
639
 
 
640
<row>
 
641
 
 
642
<entry colname="col1"><para><literal>ISO8859-5</literal></para></entry>
 
643
 
 
644
<entry colname="col2"><para><literal>866</literal></para></entry>
 
645
 
 
646
<entry colname="col3"><para>Russian Cyrillic Unix</para></entry>
 
647
 
 
648
</row>
 
649
 
 
650
<row>
 
651
 
 
652
<entry colname="col1"><para><literal>KOI8-R</literal></para></entry>
 
653
 
 
654
<entry colname="col2"><para><literal>866</literal></para></entry>
 
655
 
 
656
<entry colname="col3"><para>Alternate Russian Cyrillic Unix</para></entry>
 
657
 
 
658
</row>
 
659
 
 
660
</tbody>
 
661
</tgroup>
 
662
</table>
 
663
 
 
664
 
 
665
<para>Normally, the <literal>character</literal> <literal>set</literal> option is disabled completely.</para>
 
666
</sect2>
 
667
 
 
668
 
 
669
 
 
670
 
 
671
 
 
672
<sect2 role="" label="8.3.3" id="ch08-SECT-3.0.3">
 
673
<title>coding system</title>
 
674
 
 
675
 
 
676
<para>The <literal>coding</literal>
 
677
<indexterm id="ch08-idx-965965-0"><primary>coding system option</primary></indexterm> <literal>system</literal> option is similar to the <literal>character</literal> <literal>set</literal> option. However, its purpose is to determine how to convert a Japanese Shift JIS code page into an appropriate Unix character set. In order to use this option, the <literal>client</literal> <literal>code</literal> <literal>page</literal> option described previously must be set to page 932. The valid coding systems that Samba 2.0 accepts are listed in <link linkend="ch08-57476">Table 8.6</link>.</para>
 
678
 
 
679
 
 
680
<table label="8.6" id="ch08-57476">
 
681
<title>Valid Coding System Parameters with Samba 2.0 </title>
 
682
 
 
683
<tgroup cols="2">
 
684
<colspec colnum="1" colname="col1"/>
 
685
<colspec colnum="2" colname="col2"/>
 
686
<thead>
 
687
<row>
 
688
 
 
689
<entry colname="col1"><para>Character Set</para></entry>
 
690
 
 
691
<entry colname="col2"><para>Definition</para></entry>
 
692
 
 
693
</row>
 
694
 
 
695
</thead>
 
696
 
 
697
<tbody>
 
698
<row>
 
699
 
 
700
<entry colname="col1"><para><literal>SJIS</literal></para></entry>
 
701
 
 
702
<entry colname="col2"><para>
 
703
<indexterm id="ch08-idx-965393-0"><primary>Samba</primary><secondary>version 2.0</secondary><tertiary>coding system parameters</tertiary></indexterm>Standard Shift JIS</para></entry>
 
704
 
 
705
</row>
 
706
 
 
707
<row>
 
708
 
 
709
<entry colname="col1"><para><literal>JIS8</literal></para></entry>
 
710
 
 
711
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
712
 
 
713
</row>
 
714
 
 
715
<row>
 
716
 
 
717
<entry colname="col1"><para><literal>J8BB</literal></para></entry>
 
718
 
 
719
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
720
 
 
721
</row>
 
722
 
 
723
<row>
 
724
 
 
725
<entry colname="col1"><para><literal>J8BH</literal></para></entry>
 
726
 
 
727
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
728
 
 
729
</row>
 
730
 
 
731
<row>
 
732
 
 
733
<entry colname="col1"><para><literal>J8@B</literal></para></entry>
 
734
 
 
735
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
736
 
 
737
</row>
 
738
 
 
739
<row>
 
740
 
 
741
<entry colname="col1"><para><literal>J8@J</literal></para></entry>
 
742
 
 
743
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
744
 
 
745
</row>
 
746
 
 
747
<row>
 
748
 
 
749
<entry colname="col1"><para><literal>J8@H</literal></para></entry>
 
750
 
 
751
<entry colname="col2"><para>Eight-bit JIS codes</para></entry>
 
752
 
 
753
</row>
 
754
 
 
755
<row>
 
756
 
 
757
<entry colname="col1"><para><literal>JIS7</literal></para></entry>
 
758
 
 
759
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
760
 
 
761
</row>
 
762
 
 
763
<row>
 
764
 
 
765
<entry colname="col1"><para><literal>J7BB</literal></para></entry>
 
766
 
 
767
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
768
 
 
769
</row>
 
770
 
 
771
<row>
 
772
 
 
773
<entry colname="col1"><para><literal>J7BH</literal></para></entry>
 
774
 
 
775
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
776
 
 
777
</row>
 
778
 
 
779
<row>
 
780
 
 
781
<entry colname="col1"><para><literal>J7@B</literal></para></entry>
 
782
 
 
783
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
784
 
 
785
</row>
 
786
 
 
787
<row>
 
788
 
 
789
<entry colname="col1"><para><literal>J7@J</literal></para></entry>
 
790
 
 
791
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
792
 
 
793
</row>
 
794
 
 
795
<row>
 
796
 
 
797
<entry colname="col1"><para><literal>J7@H</literal></para></entry>
 
798
 
 
799
<entry colname="col2"><para>Seven-bit JIS codes</para></entry>
 
800
 
 
801
</row>
 
802
 
 
803
<row>
 
804
 
 
805
<entry colname="col1"><para><literal>JUNET</literal></para></entry>
 
806
 
 
807
<entry colname="col2"><para>JUNET codes</para></entry>
 
808
 
 
809
</row>
 
810
 
 
811
<row>
 
812
 
 
813
<entry colname="col1"><para><literal>JUBB</literal></para></entry>
 
814
 
 
815
<entry colname="col2"><para>JUNET codes</para></entry>
 
816
 
 
817
</row>
 
818
 
 
819
<row>
 
820
 
 
821
<entry colname="col1"><para><literal>JUBH</literal></para></entry>
 
822
 
 
823
<entry colname="col2"><para>JUNET codes</para></entry>
 
824
 
 
825
</row>
 
826
 
 
827
<row>
 
828
 
 
829
<entry colname="col1"><para><literal>JU@B</literal></para></entry>
 
830
 
 
831
<entry colname="col2"><para>JUNET codes</para></entry>
 
832
 
 
833
</row>
 
834
 
 
835
<row>
 
836
 
 
837
<entry colname="col1"><para><literal>JU@J</literal></para></entry>
 
838
 
 
839
<entry colname="col2"><para>JUNET codes</para></entry>
 
840
 
 
841
</row>
 
842
 
 
843
<row>
 
844
 
 
845
<entry colname="col1"><para><literal>JU@H</literal></para></entry>
 
846
 
 
847
<entry colname="col2"><para>JUNET codes</para></entry>
 
848
 
 
849
</row>
 
850
 
 
851
<row>
 
852
 
 
853
<entry colname="col1"><para><literal>EUC</literal></para></entry>
 
854
 
 
855
<entry colname="col2"><para>EUC codes</para></entry>
 
856
 
 
857
</row>
 
858
 
 
859
<row>
 
860
 
 
861
<entry colname="col1"><para><literal>HEX</literal></para></entry>
 
862
 
 
863
<entry colname="col2"><para>Three-byte hexidecimal code</para></entry>
 
864
 
 
865
</row>
 
866
 
 
867
<row>
 
868
 
 
869
<entry colname="col1"><para><literal>CAP</literal></para></entry>
 
870
 
 
871
<entry colname="col2"><para>Three-byte hexidecimal code (Columbia Appletalk Program)</para></entry>
 
872
 
 
873
</row>
 
874
 
 
875
</tbody>
 
876
</tgroup>
 
877
</table>
 
878
</sect2>
 
879
 
 
880
 
 
881
 
 
882
 
 
883
 
 
884
<sect2 role="" label="8.3.4" id="ch08-SECT-3.0.4">
 
885
<title>valid chars</title>
 
886
 
 
887
 
 
888
<para>The <literal>valid</literal>
 
889
<indexterm id="ch08-idx-965969-0"><primary>valid chars option</primary></indexterm> <literal>chars</literal> option is an older Samba feature that will add individual characters to a code page. However, this option is being phased out in favor of more modern coding systems. You can use this option as follows:</para>
 
890
 
 
891
 
 
892
<programlisting>valid chars = &Icirc;
 
893
valid chars = 0450:0420 0x0A20:0x0A00
 
894
valid chars = A:a</programlisting>
 
895
 
 
896
 
 
897
<para>Each of the characters in the list specified should be separated by spaces. If there is a colon between two characters or their numerical equivalents, the data to the left of the colon is considered an uppercase character, while the data to the right is considered the lowercase character. You can represent characters both by literals (if you can type them) and by octal, hexidecimal, or decimal Unicode equivalents.</para>
 
898
 
 
899
 
 
900
<para>We recommend against using this option. Instead, go with one of the standard code pages listed earlier in this section. If you do use this option, however, it must be listed after the <literal>client</literal> <literal>code</literal> <literal>page</literal> to which you wish to add the character. Otherwise, the characters will not be added.<indexterm id="ch08-idx-965533-0" class="endofrange" startref="ch08-idx-965219-0"/>
 
901
<indexterm id="ch08-idx-965533-1" class="endofrange" startref="ch08-idx-965219-1"/>
 
902
<indexterm id="ch08-idx-965533-2" class="endofrange" startref="ch08-idx-965219-2"/></para>
 
903
</sect2>
 
904
</sect1>
 
905
 
 
906
 
 
907
 
 
908
 
 
909
 
 
910
 
 
911
 
 
912
 
 
913
 
 
914
<sect1 role="" label="8.4" id="ch08-82569">
 
915
<title>WinPopup Messages</title>
 
916
 
 
917
 
 
918
<para>
 
919
<indexterm id="ch08-idx-965227-0"><primary>WinPopup tool</primary></indexterm>
 
920
<indexterm id="ch08-idx-965227-1"><primary>Windows 95/98</primary><secondary>WinPopup tool</secondary></indexterm>
 
921
<indexterm id="ch08-idx-965227-2"><primary>messages</primary><secondary>WinPopup</secondary></indexterm>You can use the WinPopup tool (<filename>WINPOPUP.EXE </filename>  ) in Windows to send messages to users, machines, or entire workgroups on the network. This tool is provided with Windows 95 OSR2 and comes standard with Windows 98. With either Windows 95 or 98, however, you need to be running WinPopup to receive and send WinPopup messages. With Windows NT, you can still receive messages without starting such a tool; they will automatically appear in a small dialog box on the screen when received. The WinPopup application is shown in <link linkend="ch08-66444">Figure 8.1</link>.</para>
 
922
 
 
923
 
 
924
<figure label="8.1" id="ch08-66444">
 
925
<title>The WinPopup application</title>
 
926
 
 
927
<graphic width="502" depth="360" fileref="figs/sam.0801.gif"></graphic>
 
928
</figure>
 
929
 
 
930
<para>Samba has a single WinPopup messaging option, <literal>message</literal> <literal>command</literal>, as shown in <link linkend="ch08-18671">Table 8.7</link>.</para>
 
931
 
 
932
 
 
933
<table label="8.7" id="ch08-18671">
 
934
<title>WinPopup Configuration Option </title>
 
935
 
 
936
<tgroup cols="5">
 
937
<colspec colnum="1" colname="col1"/>
 
938
<colspec colnum="2" colname="col2"/>
 
939
<colspec colnum="3" colname="col3"/>
 
940
<colspec colnum="4" colname="col4"/>
 
941
<colspec colnum="5" colname="col5"/>
 
942
<thead>
 
943
<row>
 
944
 
 
945
<entry colname="col1"><para>Option</para></entry>
 
946
 
 
947
<entry colname="col2"><para>Parameter</para></entry>
 
948
 
 
949
<entry colname="col3"><para>Function</para></entry>
 
950
 
 
951
<entry colname="col4"><para>Default</para></entry>
 
952
 
 
953
<entry colname="col5"><para>Scope</para></entry>
 
954
 
 
955
</row>
 
956
 
 
957
</thead>
 
958
 
 
959
<tbody>
 
960
<row>
 
961
 
 
962
<entry colname="col1"><para><literal>message command</literal></para></entry>
 
963
 
 
964
<entry colname="col2"><para>
 
965
<indexterm id="ch08-idx-965394-0"><primary>Unix</primary><secondary>options</secondary><tertiary sortas="messaging">for messaging</tertiary></indexterm>
 
966
<indexterm id="ch08-idx-965394-1"><primary>locks/locking files</primary><secondary>messaging option for</secondary></indexterm>
 
967
<indexterm id="ch08-idx-965394-2"><primary>oplocks</primary><secondary>messaging option for</secondary></indexterm>string (fully-qualified pathname)</para></entry>
 
968
 
 
969
<entry colname="col3"><para>Sets a command to run on Unix when a WinPopup message is received.</para></entry>
 
970
 
 
971
<entry colname="col4"><para>None</para></entry>
 
972
 
 
973
<entry colname="col5"><para>Global</para></entry>
 
974
 
 
975
</row>
 
976
 
 
977
</tbody>
 
978
</tgroup>
 
979
</table>
 
980
 
 
981
 
 
982
<sect2 role="" label="8.4.1" id="ch08-SECT-4.0.1">
 
983
<title>message command</title>
 
984
 
 
985
 
 
986
<para>Samba's <literal>message</literal>
 
987
<indexterm id="ch08-idx-965971-0"><primary>message command option</primary></indexterm> <literal>command</literal> option sets the path to a program that will run on the server when a Windows popup message arrives at the server. The command will be executed using the <literal>guest</literal> <literal>account</literal> user. What to do with one of these is questionable since it's probably for the Samba administrator, and Samba doesn't know his or her name. If you know there's a human using the console, the Samba team once suggested the following:</para>
 
988
 
 
989
 
 
990
<programlisting>[global]
 
991
        message command = /bin/csh -c 'xedit %s; rm %s' &amp;</programlisting>
 
992
 
 
993
 
 
994
<para>Note the use of variables here. The <literal>%s</literal> variable will become the file that the message is in. This file should be deleted when the command is finished with it; otherwise, there will be a buildup of pop-up files collecting on the Samba server. In addition, the command must fork its own process (note the &amp; after the command); otherwise the client may suspend and wait for notification that the command was sent successfully before continuing.</para>
 
995
 
 
996
 
 
997
<para>In addition to the standard variables, <link linkend="ch08-29758">Table 8.8</link> shows the three unique variables that you can use in a <literal>message</literal> <literal>command</literal>.</para>
 
998
 
 
999
 
 
1000
<table label="8.8" id="ch08-29758">
 
1001
<title>Message Command Variables </title>
 
1002
 
 
1003
<tgroup cols="2">
 
1004
<colspec colnum="1" colname="col1"/>
 
1005
<colspec colnum="2" colname="col2"/>
 
1006
<thead>
 
1007
<row>
 
1008
 
 
1009
<entry colname="col1"><para>Variable</para></entry>
 
1010
 
 
1011
<entry colname="col2"><para>Definition</para></entry>
 
1012
 
 
1013
</row>
 
1014
 
 
1015
</thead>
 
1016
 
 
1017
<tbody>
 
1018
<row>
 
1019
 
 
1020
<entry colname="col1"><para><literal>%s</literal></para></entry>
 
1021
 
 
1022
<entry colname="col2"><para>The name of the file in which the message resides</para></entry>
 
1023
 
 
1024
</row>
 
1025
 
 
1026
<row>
 
1027
 
 
1028
<entry colname="col1"><para><literal>%</literal>f</para></entry>
 
1029
 
 
1030
<entry colname="col2"><para>The name of the client that sent the message</para></entry>
 
1031
 
 
1032
</row>
 
1033
 
 
1034
<row>
 
1035
 
 
1036
<entry colname="col1"><para><literal>%t</literal></para></entry>
 
1037
 
 
1038
<entry colname="col2"><para>The name of the machine that is the destination of the message</para></entry>
 
1039
 
 
1040
</row>
 
1041
 
 
1042
</tbody>
 
1043
</tgroup>
 
1044
</table>
 
1045
</sect2>
 
1046
</sect1>
 
1047
 
 
1048
 
 
1049
 
 
1050
 
 
1051
 
 
1052
 
 
1053
 
 
1054
 
 
1055
 
 
1056
<sect1 role="" label="8.5" id="ch08-SECT-5">
 
1057
<title>Recently Added Options</title>
 
1058
 
 
1059
 
 
1060
<para>
 
1061
<indexterm id="ch08-idx-965236-0"><primary>Samba</primary><secondary>version 2.0</secondary><tertiary>new options</tertiary></indexterm>Samba has several options that appeared around the time of Samba 2.0, but are not entirely supported. However, we will give you a brief overview of their workings in this section. These options are shown in <link linkend="ch08-72538">Table 8.9</link>.</para>
 
1062
 
 
1063
 
 
1064
<table label="8.9" id="ch08-72538">
 
1065
<title>Recently Added Options </title>
 
1066
 
 
1067
<tgroup cols="5">
 
1068
<colspec colnum="1" colname="col1"/>
 
1069
<colspec colnum="2" colname="col2"/>
 
1070
<colspec colnum="3" colname="col3"/>
 
1071
<colspec colnum="4" colname="col4"/>
 
1072
<colspec colnum="5" colname="col5"/>
 
1073
<thead>
 
1074
<row>
 
1075
 
 
1076
<entry colname="col1"><para>Option</para></entry>
 
1077
 
 
1078
<entry colname="col2"><para>Parameters</para></entry>
 
1079
 
 
1080
<entry colname="col3"><para>Function</para></entry>
 
1081
 
 
1082
<entry colname="col4"><para>Default</para></entry>
 
1083
 
 
1084
<entry colname="col5"><para>Scope</para></entry>
 
1085
 
 
1086
</row>
 
1087
 
 
1088
</thead>
 
1089
 
 
1090
<tbody>
 
1091
<row>
 
1092
 
 
1093
<entry colname="col1"><para><literal>change notify timeout</literal></para></entry>
 
1094
 
 
1095
<entry colname="col2"><para>numerical (number of seconds)</para></entry>
 
1096
 
 
1097
<entry colname="col3"><para>Sets the interval between checks when a client asks to wait for a change in a specified directory.</para></entry>
 
1098
 
 
1099
<entry colname="col4"><para><literal>60</literal></para></entry>
 
1100
 
 
1101
<entry colname="col5"><para>Global</para></entry>
 
1102
 
 
1103
</row>
 
1104
 
 
1105
<row>
 
1106
 
 
1107
<entry colname="col1"><para><literal>machine password timeout</literal></para></entry>
 
1108
 
 
1109
<entry colname="col2"><para>numerical (number of seconds)</para></entry>
 
1110
 
 
1111
<entry colname="col3"><para>Sets the renewal interval for NT domain machine passwords.</para></entry>
 
1112
 
 
1113
<entry colname="col4"><para><literal>604,800</literal> (1 week )</para></entry>
 
1114
 
 
1115
<entry colname="col5"><para>Global</para></entry>
 
1116
 
 
1117
</row>
 
1118
 
 
1119
<row>
 
1120
 
 
1121
<entry colname="col1"><para><literal>stat cache</literal></para></entry>
 
1122
 
 
1123
<entry colname="col2"><para>boolean</para></entry>
 
1124
 
 
1125
<entry colname="col3"><para>If <literal>yes</literal>, Samba will cache recent name mappings.</para></entry>
 
1126
 
 
1127
<entry colname="col4"><para><literal>yes</literal></para></entry>
 
1128
 
 
1129
<entry colname="col5"><para>Global</para></entry>
 
1130
 
 
1131
</row>
 
1132
 
 
1133
<row>
 
1134
 
 
1135
<entry colname="col1"><para><literal>stat cache size</literal></para></entry>
 
1136
 
 
1137
<entry colname="col2"><para>numerical</para></entry>
 
1138
 
 
1139
<entry colname="col3"><para>Sets the size of the stat cache.</para></entry>
 
1140
 
 
1141
<entry colname="col4"><para><literal>50</literal></para></entry>
 
1142
 
 
1143
<entry colname="col5"><para>Global</para></entry>
 
1144
 
 
1145
</row>
 
1146
 
 
1147
</tbody>
 
1148
</tgroup>
 
1149
</table>
 
1150
 
 
1151
 
 
1152
<sect2 role="" label="8.5.1" id="ch08-SECT-5.0.1">
 
1153
<title>change notify timeout</title>
 
1154
 
 
1155
 
 
1156
<para>The <literal>change</literal>
 
1157
<indexterm id="ch08-idx-965973-0"><primary>change notify timeout option</primary></indexterm> <literal>notify</literal> <literal>timeout</literal> global option emulates a Windows NT SMB feature called <firstterm>change notification</firstterm>
 
1158
<indexterm id="ch08-idx-965415-0"><primary>change notification, new option for (Samba version 2.0)</primary></indexterm>. This allows a client to request that a Windows NT server periodically monitor a specific directory on a share for any changes. If any changes occur, the server will notify the client.</para>
 
1159
 
 
1160
 
 
1161
<para>As of version 2.0, Samba will perform this function for its clients. However, performing these checks too often can slow the server down considerably. This option sets the time period that Samba should wait between such checks. The default is one minute (60 seconds); however, you can use this option to specify an alternate time that Samba should wait between performing checks:</para>
 
1162
 
 
1163
 
 
1164
<programlisting>[global]
 
1165
        change notify timeout = 30</programlisting>
 
1166
</sect2>
 
1167
 
 
1168
 
 
1169
 
 
1170
 
 
1171
 
 
1172
<sect2 role="" label="8.5.2" id="ch08-SECT-5.0.2">
 
1173
<title>machine password timeout</title>
 
1174
 
 
1175
 
 
1176
<para>The <literal>machine</literal>
 
1177
<indexterm id="ch08-idx-965974-0"><primary>machine password timeout option</primary></indexterm> <literal>password</literal> <literal>timeout</literal> global option sets a retention period for NT <indexterm id="ch08-idx-965417-0"><primary>domains</primary><secondary>new option for password timeout (Samba version 2.0)</secondary></indexterm>
 
1178
<indexterm id="ch08-idx-965417-1"><primary>Windows NT</primary><secondary>passwords</secondary><tertiary>new option for timeout (Samba version 2.0)</tertiary></indexterm>domain machine passwords. The default is currently set to the same time period that Windows NT 4.0 uses: 604,800 seconds (one week). Samba will periodically attempt to change the <firstterm>machine account password</firstterm>, which is a password used specifically by another server to report changes to it. This option specifies the number of seconds that Samba should wait before attempting to change that password. The following example changes it to a single day, by specifying the following:</para>
 
1179
 
 
1180
 
 
1181
<programlisting>[global]
 
1182
        machine password timeout = 86400</programlisting>
 
1183
</sect2>
 
1184
 
 
1185
 
 
1186
 
 
1187
 
 
1188
 
 
1189
<sect2 role="" label="8.5.3" id="ch08-SECT-5.0.3">
 
1190
<title>stat cache</title>
 
1191
 
 
1192
 
 
1193
<para>The <literal>stat</literal>
 
1194
<indexterm id="ch08-idx-965977-0"><primary>stat cache option</primary></indexterm> <literal>cache</literal> global option turns on caching of recent case-insensitive name mappings. The default is <literal>yes</literal>. The Samba team recommends that you never change this parameter.</para>
 
1195
</sect2>
 
1196
 
 
1197
 
 
1198
 
 
1199
 
 
1200
 
 
1201
<sect2 role="" label="8.5.4" id="ch08-SECT-5.0.4">
 
1202
<title>stat cache size</title>
 
1203
 
 
1204
 
 
1205
<para>
 
1206
<indexterm id="ch08-idx-965418-0"><primary>cache size, new option for (Samba version 2.0)</primary></indexterm>The <literal>stat</literal>
 
1207
<indexterm id="ch08-idx-965978-0"><primary>stat cache size option</primary></indexterm> <literal>cache</literal> <literal>size</literal> global option sets the size of the cache entries to be used for the <literal>stat</literal> <literal>cache</literal> option. The default here is 50. Again, the Samba team recommends that you never change this parameter.</para>
 
1208
</sect2>
 
1209
</sect1>
 
1210
 
 
1211
 
 
1212
 
 
1213
 
 
1214
 
 
1215
 
 
1216
 
 
1217
 
 
1218
 
 
1219
<sect1 role="" label="8.6" id="ch08-70923">
 
1220
<title>Miscellaneous Options</title>
 
1221
 
 
1222
 
 
1223
<para>
 
1224
<indexterm id="ch08-idx-965426-0"><primary>operating systems</primary><secondary>miscellaneous options for</secondary></indexterm>
 
1225
<indexterm id="ch08-idx-965426-1"><primary>Windows 95/98</primary><secondary>miscellaneous options for</secondary></indexterm>
 
1226
<indexterm id="ch08-idx-965426-2"><primary>Unix</primary><secondary>options</secondary><tertiary>miscellaneous</tertiary></indexterm>Many Samba options are present to deal with operating system issues on either  Unix or Windows. The options shown in <link linkend="ch08-83566">Table 8.10</link> deal specifically with some of these known problems. We usually don't change these and we recommend the same to you.</para>
 
1227
 
 
1228
 
 
1229
<table label="8.10" id="ch08-83566">
 
1230
<title>Miscellaneous Options </title>
 
1231
 
 
1232
<tgroup cols="5">
 
1233
<colspec colnum="1" colname="col1"/>
 
1234
<colspec colnum="2" colname="col2"/>
 
1235
<colspec colnum="3" colname="col3"/>
 
1236
<colspec colnum="4" colname="col4"/>
 
1237
<colspec colnum="5" colname="col5"/>
 
1238
<thead>
 
1239
<row>
 
1240
 
 
1241
<entry colname="col1"><para>Option</para></entry>
 
1242
 
 
1243
<entry colname="col2"><para>Parameters</para></entry>
 
1244
 
 
1245
<entry colname="col3"><para>Function</para></entry>
 
1246
 
 
1247
<entry colname="col4"><para>Default</para></entry>
 
1248
 
 
1249
<entry colname="col5"><para>Scope</para></entry>
 
1250
 
 
1251
</row>
 
1252
 
 
1253
</thead>
 
1254
 
 
1255
<tbody>
 
1256
<row>
 
1257
 
 
1258
<entry colname="col1"><para><literal>deadtime</literal></para></entry>
 
1259
 
 
1260
<entry colname="col2"><para>
 
1261
<indexterm id="ch08-idx-965429-0" class="startofrange"><primary>bug avoidance options</primary></indexterm>numerical (<indexterm id="ch08-idx-965437-0" class="startofrange"><primary>bug avoidance options</primary><secondary>list of</secondary></indexterm>number of minutes)</para></entry>
 
1262
 
 
1263
<entry colname="col3"><para>Specifies the number of minutes of inactivity before a connection should be terminated.</para></entry>
 
1264
 
 
1265
<entry colname="col4"><para><literal>0</literal></para></entry>
 
1266
 
 
1267
<entry colname="col5"><para>Global</para></entry>
 
1268
 
 
1269
</row>
 
1270
 
 
1271
<row>
 
1272
 
 
1273
<entry colname="col1"><para><literal>dfree command</literal></para></entry>
 
1274
 
 
1275
<entry colname="col2"><para>string (command)</para></entry>
 
1276
 
 
1277
<entry colname="col3"><para>Used to provide a command that returns disk free space in a format recognized by Samba.</para></entry>
 
1278
 
 
1279
<entry colname="col4"><para>None</para></entry>
 
1280
 
 
1281
<entry colname="col5"><para>Global</para></entry>
 
1282
 
 
1283
</row>
 
1284
 
 
1285
<row>
 
1286
 
 
1287
<entry colname="col1"><para><literal>fstype</literal></para></entry>
 
1288
 
 
1289
<entry colname="col2"><para><literal>NTFS</literal>, <literal>FAT</literal>, or <literal>Samba</literal></para></entry>
 
1290
 
 
1291
<entry colname="col3"><para>Sets the filesystem type reported by the server to the client.</para></entry>
 
1292
 
 
1293
<entry colname="col4"><para><literal>NTFS</literal></para></entry>
 
1294
 
 
1295
<entry colname="col5"><para>Global</para></entry>
 
1296
 
 
1297
</row>
 
1298
 
 
1299
<row>
 
1300
 
 
1301
<entry colname="col1"><para><literal>keep alive</literal></para></entry>
 
1302
 
 
1303
<entry colname="col2"><para>seconds</para></entry>
 
1304
 
 
1305
<entry colname="col3"><para>Sets the number of seconds between checks for an inoperative client.</para></entry>
 
1306
 
 
1307
<entry colname="col4"><para>(none)</para></entry>
 
1308
 
 
1309
<entry colname="col5"><para>Global</para></entry>
 
1310
 
 
1311
</row>
 
1312
 
 
1313
<row>
 
1314
 
 
1315
<entry colname="col1"><para><literal>max disk size</literal></para></entry>
 
1316
 
 
1317
<entry colname="col2"><para>numerical (size in MB)</para></entry>
 
1318
 
 
1319
<entry colname="col3"><para>Sets the largest disk size to return to a client, some of which have limits. Does not affect actual operations on the disk.</para></entry>
 
1320
 
 
1321
<entry colname="col4"><para>(infinity)</para></entry>
 
1322
 
 
1323
<entry colname="col5"><para>Global</para></entry>
 
1324
 
 
1325
</row>
 
1326
 
 
1327
<row>
 
1328
 
 
1329
<entry colname="col1"><para><literal>max mux</literal></para></entry>
 
1330
 
 
1331
<entry colname="col2"><para>numerical</para></entry>
 
1332
 
 
1333
<entry colname="col3"><para>Sets the maximum number of simultaneous SMB operations that clients may make.</para></entry>
 
1334
 
 
1335
<entry colname="col4"><para><literal>50</literal></para></entry>
 
1336
 
 
1337
<entry colname="col5"><para>Global</para></entry>
 
1338
 
 
1339
</row>
 
1340
 
 
1341
<row>
 
1342
 
 
1343
<entry colname="col1"><para><literal>max open files</literal></para></entry>
 
1344
 
 
1345
<entry colname="col2"><para>numerical</para></entry>
 
1346
 
 
1347
<entry colname="col3"><para>Limits number of open files to be below Unix limits.</para></entry>
 
1348
 
 
1349
<entry colname="col4"><para><literal>10,000</literal></para></entry>
 
1350
 
 
1351
<entry colname="col5"><para>Global</para></entry>
 
1352
 
 
1353
</row>
 
1354
 
 
1355
<row>
 
1356
 
 
1357
<entry colname="col1"><para><literal>max xmit</literal></para></entry>
 
1358
 
 
1359
<entry colname="col2"><para>numerical</para></entry>
 
1360
 
 
1361
<entry colname="col3"><para>Specifies the maximum packet size that Samba will send.</para></entry>
 
1362
 
 
1363
<entry colname="col4"><para><literal>65,535</literal></para></entry>
 
1364
 
 
1365
<entry colname="col5"><para>Global</para></entry>
 
1366
 
 
1367
</row>
 
1368
 
 
1369
<row>
 
1370
 
 
1371
<entry colname="col1"><para><literal>nt pipe support</literal></para></entry>
 
1372
 
 
1373
<entry colname="col2"><para>boolean</para></entry>
 
1374
 
 
1375
<entry colname="col3"><para>Turns off an experimental NT feature, for benchmarking or in case of an error.</para></entry>
 
1376
 
 
1377
<entry colname="col4"><para><literal>yes</literal></para></entry>
 
1378
 
 
1379
<entry colname="col5"><para>Global</para></entry>
 
1380
 
 
1381
</row>
 
1382
 
 
1383
<row>
 
1384
 
 
1385
<entry colname="col1"><para><literal>nt smb support</literal></para></entry>
 
1386
 
 
1387
<entry colname="col2"><para>boolean</para></entry>
 
1388
 
 
1389
<entry colname="col3"><para>Turns off an experimental NT feature, for benchmarking or in case of an error.</para></entry>
 
1390
 
 
1391
<entry colname="col4"><para><literal>yes</literal></para></entry>
 
1392
 
 
1393
<entry colname="col5"><para>Global</para></entry>
 
1394
 
 
1395
</row>
 
1396
 
 
1397
<row>
 
1398
 
 
1399
<entry colname="col1"><para><literal>ole locking compatib-ility</literal></para></entry>
 
1400
 
 
1401
<entry colname="col2"><para>boolean</para></entry>
 
1402
 
 
1403
<entry colname="col3"><para>Remaps out-of-range lock requests used on Windows to fit in allowable range on Unix. Turning it off causes Unix lock errors.</para></entry>
 
1404
 
 
1405
<entry colname="col4"><para><literal>yes</literal></para></entry>
 
1406
 
 
1407
<entry colname="col5"><para>Global</para></entry>
 
1408
 
 
1409
</row>
 
1410
 
 
1411
<row>
 
1412
 
 
1413
<entry colname="col1"><para><literal>panic action</literal></para></entry>
 
1414
 
 
1415
<entry colname="col2"><para>command</para></entry>
 
1416
 
 
1417
<entry colname="col3"><para>Program to run if Samba server fails; for debugging.</para></entry>
 
1418
 
 
1419
<entry colname="col4"><para>None</para></entry>
 
1420
 
 
1421
<entry colname="col5"><para>Global</para></entry>
 
1422
 
 
1423
</row>
 
1424
 
 
1425
<row>
 
1426
 
 
1427
<entry colname="col1"><para><literal>set directory</literal></para></entry>
 
1428
 
 
1429
<entry colname="col2"><para>boolean</para></entry>
 
1430
 
 
1431
<entry colname="col3"><para>If <literal>yes</literal>, allows VMS clients to issue <literal>set</literal> <literal>dir</literal> commands.</para></entry>
 
1432
 
 
1433
<entry colname="col4"><para><literal>no</literal></para></entry>
 
1434
 
 
1435
<entry colname="col5"><para>Global</para></entry>
 
1436
 
 
1437
</row>
 
1438
 
 
1439
<row>
 
1440
 
 
1441
<entry colname="col1"><para><literal>smbrun</literal></para></entry>
 
1442
 
 
1443
<entry colname="col2"><para>string (fully-qualified command)</para></entry>
 
1444
 
 
1445
<entry colname="col3"><para>Sets the command Samba uses as a wrapper for shell commands.</para></entry>
 
1446
 
 
1447
<entry colname="col4"><para>None</para></entry>
 
1448
 
 
1449
<entry colname="col5"><para>Global</para></entry>
 
1450
 
 
1451
</row>
 
1452
 
 
1453
<row>
 
1454
 
 
1455
<entry colname="col1"><para><literal>status</literal></para></entry>
 
1456
 
 
1457
<entry colname="col2"><para>boolean</para></entry>
 
1458
 
 
1459
<entry colname="col3"><para>If <literal>yes</literal>, allows Samba to monitor status for <literal>smbstatus</literal> command.</para></entry>
 
1460
 
 
1461
<entry colname="col4"><para><literal>yes</literal></para></entry>
 
1462
 
 
1463
<entry colname="col5"><para>Global</para></entry>
 
1464
 
 
1465
</row>
 
1466
 
 
1467
<row>
 
1468
 
 
1469
<entry colname="col1"><para><literal>strict sync</literal></para></entry>
 
1470
 
 
1471
<entry colname="col2"><para>boolean</para></entry>
 
1472
 
 
1473
<entry colname="col3"><para>If <literal>no</literal>, ignores Windows applications requests to perform a sync-to-disk.</para></entry>
 
1474
 
 
1475
<entry colname="col4"><para><literal>no</literal></para></entry>
 
1476
 
 
1477
<entry colname="col5"><para>Global</para></entry>
 
1478
 
 
1479
</row>
 
1480
 
 
1481
<row>
 
1482
 
 
1483
<entry colname="col1"><para><literal>sync always</literal></para></entry>
 
1484
 
 
1485
<entry colname="col2"><para>boolean</para></entry>
 
1486
 
 
1487
<entry colname="col3"><para>If <literal>yes</literal>, forces all client writes to be committed to disk before returning from the call.</para></entry>
 
1488
 
 
1489
<entry colname="col4"><para><literal>no</literal></para></entry>
 
1490
 
 
1491
<entry colname="col5"><para>Global</para></entry>
 
1492
 
 
1493
</row>
 
1494
 
 
1495
<row>
 
1496
 
 
1497
<entry colname="col1"><para><literal>strip dot</literal></para></entry>
 
1498
 
 
1499
<entry colname="col2"><para>boolean</para></entry>
 
1500
 
 
1501
<entry colname="col3"><para>If <literal>yes</literal>, strips trailing dots from Unix filenames.<indexterm id="ch08-idx-965441-0" class="endofrange" startref="ch08-idx-965437-0"/></para></entry>
 
1502
 
 
1503
<entry colname="col4"><para><literal>no</literal></para></entry>
 
1504
 
 
1505
<entry colname="col5"><para>Global</para></entry>
 
1506
 
 
1507
</row>
 
1508
 
 
1509
</tbody>
 
1510
</tgroup>
 
1511
</table>
 
1512
 
 
1513
 
 
1514
<sect2 role="" label="8.6.1" id="ch08-SECT-6.0.1">
 
1515
<indexterm id="ch08-idx-965979-0"><primary>deadtime option</primary></indexterm>
 
1516
<title>
 
1517
deadtime</title>
 
1518
 
 
1519
 
 
1520
<para>This global option sets the number of minutes that Samba will wait for an inactive client before closing its session with the Samba server. A client is considered inactive when it has no open files and there is no data being sent from it. The default value for this option is 0, which means that Samba never closes any connections no matter how long they have been inactive. You can override it as follows:</para>
 
1521
 
 
1522
 
 
1523
<programlisting>[global]
 
1524
        deadtime = 10</programlisting>
 
1525
 
 
1526
 
 
1527
<para>This tells Samba to terminate any inactive client sessions after 10 minutes. For most networks, setting this option as such will work because reconnections from the client are generally performed transparently to the user.</para>
 
1528
</sect2>
 
1529
 
 
1530
 
 
1531
 
 
1532
 
 
1533
 
 
1534
<sect2 role="" label="8.6.2" id="ch08-SECT-6.0.2">
 
1535
<indexterm id="ch08-idx-965980-0"><primary>dfree command option</primary></indexterm>
 
1536
<title>
 
1537
dfree command</title>
 
1538
 
 
1539
 
 
1540
<para>
 
1541
<indexterm id="ch08-idx-965466-0"><primary>free space on disk, option for</primary></indexterm>This global option is used on systems that incorrectly determine the free space left on the disk. So far, the only confirmed system that needs this option set is Ultrix. There is no default value for this option, which means that Samba already knows how to compute the free disk space on its own and the results are considered reliable. You can override it as follows:</para>
 
1542
 
 
1543
 
 
1544
<programlisting>[global]
 
1545
        dfree command = /usr/local/bin/dfree</programlisting>
 
1546
 
 
1547
 
 
1548
<para>This option should point to a script that should return the total disk space in a block, and the number of available blocks. The Samba documentation recommends the following as a usable script:</para>
 
1549
 
 
1550
 
 
1551
<programlisting>#!/bin/sh
 
1552
df $1 | tail -1 | awk '{print $2" "$4}'</programlisting>
 
1553
 
 
1554
 
 
1555
<para>On System V machines, the following will work:</para>
 
1556
 
 
1557
 
 
1558
<programlisting>#!/bin/sh
 
1559
/usr/bin/df $1 | tail -1 | awk '{print $3" "$5}'</programlisting>
 
1560
</sect2>
 
1561
 
 
1562
 
 
1563
 
 
1564
 
 
1565
 
 
1566
<sect2 role="" label="8.6.3" id="ch08-SECT-6.0.3">
 
1567
<indexterm id="ch08-idx-965983-0"><primary>fstype option</primary></indexterm>
 
1568
<title>
 
1569
fstype</title>
 
1570
 
 
1571
 
 
1572
<para>This share-level option sets the type of <indexterm id="ch08-idx-965467-0"><primary>filesystems</primary><secondary>reporting on by Samba, option for</secondary></indexterm>filesystem that Samba reports when queried by the client. There are three strings that can be used as a value to this configuration option, as listed in <link linkend="ch08-80519">Table 8.11</link>.</para>
 
1573
 
 
1574
 
 
1575
<table label="8.11" id="ch08-80519">
 
1576
<title>Filesystem Types </title>
 
1577
 
 
1578
<tgroup cols="2">
 
1579
<colspec colnum="1" colname="col1"/>
 
1580
<colspec colnum="2" colname="col2"/>
 
1581
<thead>
 
1582
<row>
 
1583
 
 
1584
<entry colname="col1"><para>Variable</para></entry>
 
1585
 
 
1586
<entry colname="col2"><para>Definition</para></entry>
 
1587
 
 
1588
</row>
 
1589
 
 
1590
</thead>
 
1591
 
 
1592
<tbody>
 
1593
<row>
 
1594
 
 
1595
<entry colname="col1"><para>NTFS</para></entry>
 
1596
 
 
1597
<entry colname="col2"><para>
 
1598
<indexterm id="ch08-idx-965468-0"><primary>filesystems</primary><secondary>types</secondary></indexterm>Microsoft Windows NT filesystem</para></entry>
 
1599
 
 
1600
</row>
 
1601
 
 
1602
<row>
 
1603
 
 
1604
<entry colname="col1"><para>FAT</para></entry>
 
1605
 
 
1606
<entry colname="col2"><para>DOS FAT filesystem</para></entry>
 
1607
 
 
1608
</row>
 
1609
 
 
1610
<row>
 
1611
 
 
1612
<entry colname="col1"><para>Samba</para></entry>
 
1613
 
 
1614
<entry colname="col2"><para>Samba filesystem</para></entry>
 
1615
 
 
1616
</row>
 
1617
 
 
1618
</tbody>
 
1619
</tgroup>
 
1620
</table>
 
1621
 
 
1622
 
 
1623
<para>The default value for this option is <literal>NTFS</literal>, which represents a Windows NT filesystem. There probably isn't a need to specify any other type of filesystem. However, if you need to, you can override it per share as follows:</para>
 
1624
 
 
1625
 
 
1626
<programlisting>[data]
 
1627
        fstype = FAT</programlisting>
 
1628
</sect2>
 
1629
 
 
1630
 
 
1631
 
 
1632
 
 
1633
 
 
1634
<sect2 role="" label="8.6.4" id="ch08-SECT-6.0.4">
 
1635
<title>keep alive</title>
 
1636
 
 
1637
 
 
1638
<para>
 
1639
<indexterm id="ch08-idx-965469-0"><primary>keep-alive packets, option for</primary></indexterm>This global option specifies the number of seconds that Samba waits between sending NetBIOS <emphasis>keep-alive packets</emphasis>. These packets are used to ping a client to detect whether it is still alive and on the network. The default value for this option is <literal>0</literal>, which means that Samba will not send any such packets at all. You can override it as follows:</para>
 
1640
 
 
1641
 
 
1642
<programlisting>[global]
 
1643
        keep alive = 10</programlisting>
 
1644
</sect2>
 
1645
 
 
1646
 
 
1647
 
 
1648
 
 
1649
 
 
1650
<sect2 role="" label="8.6.5" id="ch08-SECT-6.0.5">
 
1651
<indexterm id="ch08-idx-965985-0"><primary>max disk size option</primary></indexterm>
 
1652
<title>
 
1653
max disk size</title>
 
1654
 
 
1655
 
 
1656
<para>
 
1657
<indexterm id="ch08-idx-965470-0"><primary>disk shares</primary><secondary>maximum size of, option for</secondary></indexterm>This global option specifies an illusory limit, in megabytes, for each of the shares that Samba is using. You would typically set this option to prevent clients with older operating systems from incorrectly processing large disk spaces, such as those over one gigabyte.</para>
 
1658
 
 
1659
 
 
1660
<para>The default value for this option is <literal>0</literal>, which means there is no upper limit at all. You can override it as follows:</para>
 
1661
 
 
1662
 
 
1663
<programlisting>[global]
 
1664
        max disk size = 1000</programlisting>
 
1665
</sect2>
 
1666
 
 
1667
 
 
1668
 
 
1669
 
 
1670
 
 
1671
<sect2 role="" label="8.6.6" id="ch08-SECT-6.0.6">
 
1672
<indexterm id="ch08-idx-965986-0"><primary>max mux option</primary></indexterm>
 
1673
<title>
 
1674
max mux</title>
 
1675
 
 
1676
 
 
1677
<para>
 
1678
<indexterm id="ch08-idx-965471-0"><primary>SMB (Server Message Block)</primary><secondary>maximum number of operations, option&nbsp;for</secondary></indexterm>This global option specifies the maximum number of concurrent SMB operations that Samba allows. The default value for this option is <literal>50</literal>. You can override it as follows:</para>
 
1679
 
 
1680
 
 
1681
<programlisting>[global]
 
1682
        max mux = 100</programlisting>
 
1683
</sect2>
 
1684
 
 
1685
 
 
1686
 
 
1687
 
 
1688
 
 
1689
<sect2 role="" label="8.6.7" id="ch08-SECT-6.0.7">
 
1690
<indexterm id="ch08-idx-965987-0"><primary>max open files option</primary></indexterm>
 
1691
<title>
 
1692
max open files</title>
 
1693
 
 
1694
 
 
1695
<para>
 
1696
<indexterm id="ch08-idx-965478-0"><primary>files</primary><secondary>open, option for maximum number&nbsp;of</secondary></indexterm>This global option specifies the maximum number of open files that Samba should allow at any given time for all processes. This value must be equal to or less than the amount allowed by the operating system, which varies from system to system. The default value for this option is <literal>10,000</literal>. You can override it as follows:</para>
 
1697
 
 
1698
 
 
1699
<programlisting>[global]
 
1700
        max open files = 8000</programlisting>
 
1701
</sect2>
 
1702
 
 
1703
 
 
1704
 
 
1705
 
 
1706
 
 
1707
<sect2 role="" label="8.6.8" id="ch08-SECT-6.0.8">
 
1708
<indexterm id="ch08-idx-965988-0"><primary>max xmit option</primary></indexterm>
 
1709
<title>
 
1710
max xmit</title>
 
1711
 
 
1712
 
 
1713
<para>
 
1714
<indexterm id="ch08-idx-965482-0"><primary>packets</primary><secondary>maximum size of, option for</secondary></indexterm>This global option sets the maximum size of packets that Samba exchanges with a client. In some cases, setting a smaller maximum packet size can increase performance, especially with Windows for Workgroups. The default value for this option is <literal>65535</literal>. You can override it as follows:</para>
 
1715
 
 
1716
 
 
1717
<programlisting>[global]
 
1718
        max xmit = 4096</programlisting>
 
1719
 
 
1720
 
 
1721
<para><link linkend="appb-19919">Section 2.2.2.6</link> in <link linkend="SAMBA-AP-B">Appendix B</link>," shows some uses for this option.</para>
 
1722
</sect2>
 
1723
 
 
1724
 
 
1725
 
 
1726
 
 
1727
 
 
1728
<sect2 role="" label="8.6.9" id="ch08-SECT-6.0.9">
 
1729
<indexterm id="ch08-idx-965989-0"><primary>nt pipe support option</primary></indexterm>
 
1730
<title>
 
1731
nt pipe support</title>
 
1732
 
 
1733
 
 
1734
<para>
 
1735
<indexterm id="ch08-idx-965483-0"><primary>Windows NT</primary><secondary>pipes, option for</secondary></indexterm>This global option is used by developers to allow or disallow Windows NT clients the ability to make connections to the NT SMB-specific IPC$ pipes. As a user, you should never need to override the default:</para>
 
1736
 
 
1737
 
 
1738
<programlisting>[global]
 
1739
        nt pipe support = yes</programlisting>
 
1740
</sect2>
 
1741
 
 
1742
 
 
1743
 
 
1744
 
 
1745
 
 
1746
<sect2 role="" label="8.6.10" id="ch08-SECT-6.0.10">
 
1747
<indexterm id="ch08-idx-965990-0"><primary>nt smb support option</primary></indexterm>
 
1748
<title>
 
1749
nt smb support</title>
 
1750
 
 
1751
 
 
1752
<para>
 
1753
<indexterm id="ch08-idx-965484-0"><primary>Windows NT</primary><secondary>SMB, option for</secondary></indexterm>
 
1754
<indexterm id="ch08-idx-965484-1"><primary>SMB (Server Message Block)</primary><secondary>option for NT-specific options</secondary></indexterm>This global option is used by developers to negotiate NT-specific SMB options with Windows NT clients. The Samba team has discovered that slightly better performance comes from setting this value to <literal>no</literal>. However, as a user, you should probably not override the default:</para>
 
1755
 
 
1756
 
 
1757
<programlisting>[global]
 
1758
        nt smb support = yes</programlisting>
 
1759
</sect2>
 
1760
 
 
1761
 
 
1762
 
 
1763
 
 
1764
 
 
1765
<sect2 role="" label="8.6.11" id="ch08-SECT-6.0.11">
 
1766
<indexterm id="ch08-idx-965991-0"><primary>ole locking compatibility option</primary></indexterm>
 
1767
<title>
 
1768
ole locking compatibility</title>
 
1769
 
 
1770
 
 
1771
<para>This global option turns off Samba's internal byte-range locking manipulation in files, which gives compatibility with Object Linking and Embedding (OLE) applications that use high byte-range locks as a method of interprocess communication. The default value for this option is <literal>yes</literal>. If you trust your Unix locking mechanisms, you can override it as follows:</para>
 
1772
 
 
1773
 
 
1774
<programlisting>[global]
 
1775
        ole locking compatibility = no</programlisting>
 
1776
</sect2>
 
1777
 
 
1778
 
 
1779
 
 
1780
 
 
1781
 
 
1782
<sect2 role="" label="8.6.12" id="ch08-SECT-6.0.12">
 
1783
<indexterm id="ch08-idx-965992-0"><primary>panic action option</primary></indexterm>
 
1784
<title>
 
1785
panic action</title>
 
1786
 
 
1787
 
 
1788
<para>
 
1789
<indexterm id="ch08-idx-965492-0"><primary>fatal error, option for</primary></indexterm>This global option specifies a command to execute in the event that Samba itself encounters a fatal error when loading or running. There is no default value for this option. You can specify an action as follows:</para>
 
1790
 
 
1791
 
 
1792
<programlisting>[global]
 
1793
        panic action = /bin/csh -c
 
1794
          'xedit &lt; "Samba has shutdown unexpectedly!'</programlisting>
 
1795
</sect2>
 
1796
 
 
1797
 
 
1798
 
 
1799
 
 
1800
 
 
1801
<sect2 role="" label="8.6.13" id="ch08-SECT-6.0.13">
 
1802
<indexterm id="ch08-idx-965993-0"><primary>set directory option</primary></indexterm>
 
1803
<title>
 
1804
set directory</title>
 
1805
 
 
1806
 
 
1807
<para>This boolean share-level option allows <indexterm id="ch08-idx-965497-0"><primary>Digital Pathworks clients, option for</primary></indexterm>Digital Pathworks clients to use the <literal>setdir</literal> command to change directories on the server. If you are not using the Digital Pathworks client, you should not need to alter this option. The default value for this option is <literal>no</literal>. You can override it per share as follows:</para>
 
1808
 
 
1809
 
 
1810
<programlisting>[data]
 
1811
        set directory = yes</programlisting>
 
1812
</sect2>
 
1813
 
 
1814
 
 
1815
 
 
1816
 
 
1817
 
 
1818
<sect2 role="" label="8.6.14" id="ch08-SECT-6.0.14">
 
1819
<indexterm id="ch08-idx-965994-0"><primary>smbrun option</primary></indexterm>
 
1820
<title>
 
1821
smbrun</title>
 
1822
 
 
1823
 
 
1824
<para>This option sets the location of the <emphasis>smbrun</emphasis> executable, which Samba uses as a wrapper to run shell commands. The default value for this option is automatically configured by Samba when it is compiled. If you did not install Samba to the standard directory, you can specify where the binary is as follows:</para>
 
1825
 
 
1826
 
 
1827
<programlisting>[global]
 
1828
        smbrun = /usr/local/bin/smbrun</programlisting>
 
1829
</sect2>
 
1830
 
 
1831
 
 
1832
 
 
1833
 
 
1834
 
 
1835
<sect2 role="" label="8.6.15" id="ch08-SECT-6.0.15">
 
1836
<indexterm id="ch08-idx-965995-0"><primary>status option</primary></indexterm>
 
1837
<title>
 
1838
status</title>
 
1839
 
 
1840
 
 
1841
<para>This global option indicates whether Samba should log all <indexterm id="ch08-idx-965499-0"><primary>active connections, option for</primary></indexterm>
 
1842
<indexterm id="ch08-idx-965499-1"><primary>connections</primary><secondary>active, option for</secondary></indexterm>active connections to   a status file. This file is used only by the <emphasis>smbstatus</emphasis> command. If you have no intentions of using this command, you can set this option to <literal>no</literal>, which can result in a small increase of speed on the server. The default value for this option is <literal>yes</literal>. You can override it as follows:</para>
 
1843
 
 
1844
 
 
1845
<programlisting>[global]
 
1846
        status = no</programlisting>
 
1847
</sect2>
 
1848
 
 
1849
 
 
1850
 
 
1851
 
 
1852
 
 
1853
<sect2 role="" label="8.6.16" id="ch08-SECT-6.0.16">
 
1854
<indexterm id="ch08-idx-965996-0"><primary>strict sync option</primary></indexterm>
 
1855
<title>
 
1856
strict sync</title>
 
1857
 
 
1858
 
 
1859
<para>This share-level option determines whether Samba honors all requests to perform a <indexterm id="ch08-idx-965500-0"><primary>disk sync, options for</primary></indexterm>disk sync when requested to do so by a client. Many clients request a disk sync when they are really just trying to flush data to their own open files. As a result, this can substantially slow a Samba server down. The default value for this option is <literal>no</literal>. You can override it as follows:</para>
 
1860
 
 
1861
 
 
1862
<programlisting>[data]
 
1863
        strict sync = yes</programlisting>
 
1864
</sect2>
 
1865
 
 
1866
 
 
1867
 
 
1868
 
 
1869
 
 
1870
<sect2 role="" label="8.6.17" id="ch08-SECT-6.0.17">
 
1871
<indexterm id="ch08-idx-965997-0"><primary>sync always option</primary></indexterm>
 
1872
<title>
 
1873
sync always</title>
 
1874
 
 
1875
 
 
1876
<para>This share-level option decides whether every write to disk should be followed by a disk synchronization before the write call returns control to the client. Even if the value of this option is <literal>no</literal>, clients can request a disk synchronization; see the <literal>strict</literal> <literal>sync</literal> option above. The default value for this option is <literal>no</literal>. You can override it per share as follows:</para>
 
1877
 
 
1878
 
 
1879
<programlisting>[data]
 
1880
        sync always = yes</programlisting>
 
1881
</sect2>
 
1882
 
 
1883
 
 
1884
 
 
1885
 
 
1886
 
 
1887
<sect2 role="" label="8.6.18" id="ch08-SECT-6.0.18">
 
1888
<indexterm id="ch08-idx-965998-0"><primary>strip dot option</primary></indexterm>
 
1889
<title>
 
1890
strip dot</title>
 
1891
 
 
1892
 
 
1893
<para>This global option determines whether to remove the <indexterm id="ch08-idx-965502-0"><primary>trailing dot, option for</primary></indexterm>
 
1894
<indexterm id="ch08-idx-965502-1"><primary>filenames</primary><secondary>Unix, option for</secondary></indexterm>
 
1895
<indexterm id="ch08-idx-965502-2"><primary>Unix</primary><secondary>filenames, option for</secondary></indexterm>trailing dot from Unix filenames that are formatted with a dot at the end. The default value for this option is <literal>no</literal>. You can override it per share as follows:</para>
 
1896
 
 
1897
 
 
1898
<programlisting>[global]
 
1899
        strip dot = yes</programlisting>
 
1900
 
 
1901
 
 
1902
<para>This option is now considered obsolete; the user should use the <literal>mangled</literal> <literal>map</literal> option insead.<indexterm id="ch08-idx-965454-0" class="endofrange" startref="ch08-idx-965429-0"/></para>
 
1903
</sect2>
 
1904
</sect1>
 
1905
 
 
1906
 
 
1907
 
 
1908
 
 
1909
 
 
1910
 
 
1911
 
 
1912
 
 
1913
 
 
1914
<sect1 role="" label="8.7" id="ch08-74829">
 
1915
<title>Backups with smbtar</title>
 
1916
 
 
1917
 
 
1918
<para>
 
1919
<indexterm id="ch08-idx-965244-0" class="startofrange"><primary>smbtar program</primary></indexterm>
 
1920
<indexterm id="ch08-idx-965244-1" class="startofrange"><primary>backups, with smbtar program</primary></indexterm>Our final topic in this chapter is the <filename>smbtar</filename> tool. One common problem with modem PCs is that floppies and even CD-ROMs are often too small to use for backups. However, buying one tape drive per machine would also be silly. Consequently, many sites don't back up their PCs at all. Instead, they reinstall them using floppy disks and CD-ROMs when they fail.</para>
 
1921
 
 
1922
 
 
1923
<para>Thankfully, Samba provides us with another option: you can back up PCs' data using the <filename>smbtar</filename> tool. This can be done on a regular basis if you keep user data on your Samba system, or only occasionally, to save the local applications and configuration files and thus make repairs and reinstallations quicker.</para>
 
1924
 
 
1925
 
 
1926
<para>To back up PCs from a <indexterm id="ch08-idx-965519-0"><primary>Unix</primary><secondary>servers, backing up computers from</secondary></indexterm>Unix server, you need to do three things:</para>
 
1927
 
 
1928
 
 
1929
<orderedlist>
 
1930
<listitem><para>Ensure that File and Printer Sharing is installed on the PC and is bound to the TCP/IP protocol.</para></listitem>
 
1931
<listitem><para>Explicitly share a disk on the PC so it can be read from the server.</para></listitem>
 
1932
<listitem><para>Set up the backup scripts on the server.</para></listitem>
 
1933
</orderedlist>
 
1934
 
 
1935
<para>We'll use Windows 95/98 to illustrate the first two steps. Go to the Networking icon in the Control Panel window, and check that <indexterm id="ch08-idx-965520-0"><primary sortas="File and Printer Sharing for Microsoft Networks">"File and Printer Sharing for Microsoft Networks"</primary></indexterm>File and Printer Sharing for Microsoft Networks is currently listed in the top window, as shown in <link linkend="ch08-18303">Figure 8.2</link>.</para>
 
1936
 
 
1937
 
 
1938
<figure label="8.2" id="ch08-18303">
 
1939
<title>The Networking window</title>
 
1940
 
 
1941
<graphic width="502" depth="368" fileref="figs/sam.0802.gif"></graphic>
 
1942
</figure>
 
1943
 
 
1944
<para>If "File and printer sharing for Microsoft Networks" isn't installed, you can install it  by clicking on the Add button on the Network panel. After pressing it, you will be asked what service to add. Select Service and move forward, and you will be asked for a vendor and a service to install. Finally, select "File and printer sharing for Microsoft Networks," and click on Done to install the service.</para>
 
1945
 
 
1946
 
 
1947
<para>Once you've installed "File and printer sharing for Microsoft Networks," return to the Network panel and select the TCP/IP protocol that is tied to your Samba network adapter. Then, click on the Properties button and choose the Bindings tab at the top. You should see a dialog box similar to <link linkend="ch08-41042">Figure 8.3</link>. Here, you'll need to verify that the "File and Printer Sharing" checkbox is checked, giving it access to TCP/IP. At this point you can share disks with other machines on the net.</para>
 
1948
 
 
1949
 
 
1950
<figure label="8.3" id="ch08-41042">
 
1951
<title>TCP/IP Bindings</title>
 
1952
 
 
1953
<graphic width="502" depth="248" fileref="figs/sam.0803.gif"></graphic>
 
1954
</figure>
 
1955
 
 
1956
<para>The next step is to share the disk you want to back up with the tape server. Go to My Computer and select, for example, the My Documents directory. Then right-click on the icon and select its Properties. This should yield the dialog box in <link linkend="ch08-64918">Figure 8.4</link>.</para>
 
1957
 
 
1958
 
 
1959
<figure label="8.4" id="ch08-64918">
 
1960
<title>My Documents Properties</title>
 
1961
 
 
1962
<graphic width="502" depth="352" fileref="figs/sam.0804.gif"></graphic>
 
1963
</figure>
 
1964
 
 
1965
<para>Select the Sharing tab and turn file sharing on. You now have the choice to share the disk as read-only, read-write (Full), or either, each with separate password. This is the Windows 95/98 version, so it provides only share-level security. In this example, we made it read/write and set a password, as shown in <link linkend="ch08-29192">Figure 8.5</link>. When you enter the password and click on OK, you'll be prompted to re-enter it. After that, you have finished the second step.</para>
 
1966
 
 
1967
 
 
1968
<figure label="8.5" id="ch08-29192">
 
1969
<title>MyFiles Properties as shared</title>
 
1970
 
 
1971
<graphic width="502" depth="374" fileref="figs/sam.0805.gif"></graphic>
 
1972
</figure>
 
1973
 
 
1974
<para>Finally, the last step is to set up a backup script on the tape server, using the <filename>smbtar</filename> program. The simplest script might contain only a single line and would be something like the following:</para>
 
1975
 
 
1976
 
 
1977
<programlisting>smbtar -s client -t /dev/rst0 -x "My Documents" -p <replaceable>password</replaceable></programlisting>
 
1978
 
 
1979
 
 
1980
<para>This unconditionally backs up the <emphasis>//client/My Documents</emphasis> share to the device <filename>/dev/rst0</filename>. Of course, this is excessively simple and quite insecure. What you will want to do will depend on your existing backup scheme.</para>
 
1981
 
 
1982
 
 
1983
<para>However, to whet your appetite, here are some possibilities of what <filename>smbtar</filename> can do:</para>
 
1984
 
 
1985
 
 
1986
<itemizedlist>
 
1987
<listitem><para>Back up files incrementally using the DOS archive bit (the <literal>-i</literal> option). This requires the client share to be accessed read-write so the bit can be cleared by <filename>smbtar</filename></para></listitem>
 
1988
<listitem><para>Back up only files that have changed since a specified date (using the <literal>-N</literal> <replaceable>filename </replaceable>option)</para></listitem>
 
1989
<listitem><para>Back up entire PC drives, by sharing all of C: or D:, for example, and backing that up</para></listitem>
 
1990
</itemizedlist>
 
1991
 
 
1992
<para>Except for the first example, each of these can be done with the PC sharing set to read-only, reducing the security risk of having passwords in scripts and passing them on the command line.<indexterm id="ch08-idx-965514-0" class="endofrange" startref="ch08-idx-965244-0"/>
 
1993
<indexterm id="ch08-idx-965514-1" class="endofrange" startref="ch08-idx-965244-1"/></para>
 
1994
</sect1>
 
1995
</chapter>