1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123
|
<html>
<body bgcolor="#ffffff">
<img src="samba2_xs.gif" border="0" alt=" " height="100" width="76"
hspace="10" align="left" />
<h1 class="head0">Chapter 11. Additional Samba Information</h1>
<p>This chapter wraps up our coverage of the
<em class="filename">smb.conf</em> configuration file with some
miscellaneous options that can perform a variety of tasks. We talk
briefly about options for time synchronization, internationalization,
messages, and common Windows bugs. For the most part, you will use
these options only in isolated circumstances.</p>
<div class="sect1"><a name="samba2-CHP-11-SECT-1"/>
<h2 class="head1">Time Synchronization</h2>
<p>In a network of computers, the systems on the network must agree on
the current time and also on what time files have been modified. One
example of the importance of synchronization is the
<a name="INDEX-1"/>roaming profiles we covered in
<a href="ch04.html">Chapter 4</a>. It is vital for all clients accessing a
roaming profile to agree on what time it is and which client last
modified the user's profile.</p>
<p><a name="INDEX-2"/>Time synchronization can also be
very important to programmers. A useful group of settings consists of
the following options:</p>
<blockquote><pre class="code">[global]
time server = yes
dos filetimes = yes
fake directory create times = yes
dos filetime resolution = yes
delete readonly = yes</pre></blockquote>
<p>If you set these options, Samba shares will provide compatibility of
file-modification times that Visual C++, <em class="emphasis">nmake</em>,
and other Microsoft programming tools require. Otherwise, PC
<em class="emphasis">make</em> programs might think that all the files in
a directory need to be recompiled every time. Obviously, this is not
the behavior you want.</p>
<p>In <a href="ch04.html">Chapter 4</a>, we showed you how to create a logon
script that used the <em class="emphasis">net
time</em><a name="INDEX-3"/> command to synchronize
clients' clocks automatically when they log on to
the domain. If your network is configured as a workgroup rather than
a domain, you can still make use of <em class="emphasis">net time</em> by
placing the command:</p>
<blockquote><pre class="code">net time \\<em class="replaceable">sambaserver</em> /set /yes</pre></blockquote>
<p>in a startup script on each client that is run when the system boots.
Samba always provides time service—regardless of whether it is
running as a primary domain controller—or the
<tt class="literal">time</tt> <tt class="literal">service</tt> configuration file
parameter is set.</p>
<p>Assuming that domain users log on to the domain at least once per day
and workgroup clients reboot frequently, the <em class="emphasis">net
time</em> command can keep client systems'
clocks fairly well synchronized. However, sometimes domain users stay
logged on for longer periods, and workgroup clients can run for days
between reboots. In the meantime, the systems'
hardware clocks can wander enough to become a problem. It might be
possible to work around this, depending on the version of Windows the
client system is running. On Windows 98/Me, you can use the Task
Scheduler to run the <em class="emphasis">net time</em> command at regular
intervals. Likewise, on Windows 2000/XP you can use the MS-DOS
<em class="emphasis">at</em> command. However, a better way to deal with
this issue is to use Network Time Protocol, which we will discuss
shortly.</p>
<p>Proper time synchronization is also important when operating in an
Active Directory domain because Active Directory uses
<a name="INDEX-4"/>Kerberos authentication.
When a Kerberos domain controller creates an authentication ticket
for a client, the time is encoded into the challenge-and-response
exchanges between the client and domain controller. If the
client's clock disagrees with the
server's clock, authentication can fail.</p>
<p>To provide proper time synchronization in <a name="INDEX-5"/>Active Directory domains, Microsoft has
adopted <a name="INDEX-6"/>Network Time Protocol (NTP), using the
name Windows Time Service for its implementation. For further
information, the Microsoft white paper entitled <em class="citetitle">The
Windows Time Service</em> can be downloaded from <a href="http://www.microsoft.com">http://www.microsoft.com</a>.</p>
<p>The nice thing about this is that NTP is the standard method for
synchronizing Unix hosts on a network, so you can synchronize all
your Unix systems (including the Samba server) and Windows systems
with the following method:</p>
<ol><li>
<p>Run NTP on the Unix systems in your network. For more information on
using NTP, refer to <a href="http://www.ntp.org">http://www.ntp.org</a>.</p>
</li><li>
<p>Use one of the Unix systems (such as the Samba host system) as an NTP
server to serve Windows 2000/XP clients.</p>
</li><li>
<p>For other Windows clients, you might have to download an update from
Microsoft to add <a name="INDEX-7"/><a name="INDEX-8"/>Windows Time Service client support or
use a third-party application such as the free
<a name="INDEX-9"/>analogX Atomic TimeSync (<a href="http://www.analogx.com">http://www.analogx.com</a>). Or you can use the
<em class="emphasis">net time</em> command to update the
client's clock periodically, as discussed
previously.</p>
</li></ol>
<div class="sect2"><a name="samba2-CHP-11-SECT-1.1"/>
<h3 class="head2">Time-Synchronization Options</h3>
<p>To support roaming profiles, programmers accessing your Samba server,
and other time-sensitive functions on your network,
you'll want to be aware of the options listed in
<a href="ch11.html#samba2-CHP-11-TABLE-1">Table 11-1</a>.</p>
<a name="samba2-CHP-11-TABLE-1"/><h4 class="head4">Table 11-1. Time-synchronization options</h4><table border="1">
<tr>
<th>
<p>Option</p>
</th>
<th>
<p>Parameters</p>
</th>
<th>
<p>Function</p>
</th>
<th>
<p>Default</p>
</th>
<th>
<p>Scope</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">time server</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, announces <em class="emphasis">nmbd</em> as an
SMB time service to Windows clients</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">time offset</tt></p>
</td>
<td>
<p>numeric</p>
</td>
<td>
<p>Adds a specified number of minutes to the reported time</p>
</td>
<td>
<p><tt class="literal">0</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">dos filetimes</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Allows non-owners of a file to change its time if they can write to it</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Share</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">dos filetime</tt></p>
<p><tt class="literal">resolution</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Causes file times to be rounded to the next even second</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Share</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">fake directory</tt> <tt class="literal">create times</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Sets directory times to avoid an MS <em class="emphasis">nmake</em> bug</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Share</p>
</td>
</tr>
</table>
<div class="sect3"><a name="samba2-CHP-11-SECT-1.1.1"/>
<a name="INDEX-12"/><h3 class="head3">time server</h3>
<p>Samba always operates as an SMB time server, matching the behavior of
Windows systems. However, Samba's default is not to
advertise itself as a time server to the network. When this option is
set to <tt class="literal">yes</tt>, Samba advertises itself as an SMB time
server:</p>
<blockquote><pre class="code">[global]
time service = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-1.1.2"/>
<a name="INDEX-13"/><h3 class="head3">time offset</h3>
<p>To deal with clients that don't properly process
daylight savings time, Samba provides the <tt class="literal">time</tt>
<tt class="literal">offset</tt> 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:</p>
<blockquote><pre class="code">[global]
time offset = 30</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-1.1.3"/>
<a name="INDEX-14"/><h3 class="head3">dos filetimes</h3>
<p>Traditionally, only the root user and the owner of a file can change
its last-modified date on a Unix system. The share-level
<tt class="literal">dos</tt> <tt class="literal">filetimes</tt> option allows the
Samba server to mimic the characteristics of a DOS or Windows system:
any user can change the last-modified date on a file in that share if
she has write permission to it. To do this, Samba uses its root
privileges to modify the timestamp on the file.</p>
<p>By default, this option is disabled. Setting this option to
<tt class="literal">yes</tt> is often necessary to allow PC
<em class="emphasis">make</em> programs to work properly. Without it, they
cannot change the last-modified date themselves. This often results
in the program thinking <em class="emphasis">all</em> files need
recompiling when they really don't.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-1.1.4"/>
<h3 class="head3">dos filetime resolution</h3>
<p>The <tt class="literal">dos</tt><a name="INDEX-15"/>
<tt class="literal">filetime</tt> <tt class="literal">resolution</tt> parameter
is a share-level option. If set to <tt class="literal">yes</tt>, Samba
rounds file times to the closest 2-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:</p>
<blockquote><pre class="code">[data]
dos filetime resolution = yes</pre></blockquote>
<p>We recommend using this option only if you are using Microsoft Visual
C++ on a Samba share that supports opportunistic locking.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-1.1.5"/>
<h3 class="head3">fake directory create times</h3>
<p>The <tt class="literal">fake</tt><a name="INDEX-16"/>
<tt class="literal">directory</tt> <tt class="literal">create</tt>
<tt class="literal">times</tt> option exists to keep PC
<em class="emphasis">make</em> 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:</p>
<blockquote><pre class="code">[data]
fake directory create times = yes</pre></blockquote>
<p>If set, Samba will adjust the directory create time it reports to the
hardcoded value January 1, 1980. This is primarily used to convince
the Visual C++ <em class="emphasis">nmake</em> 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. <a name="INDEX-17"/> <a name="INDEX-18"/><a name="INDEX-19"/></p>
</div>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-11-SECT-2"/>
<h2 class="head1">Magic Scripts</h2>
<p><em class="firstterm">Magic scripts</em> are a method of running programs
on Unix and redirecting the output back to the 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.</p>
<div class="sect2"><a name="samba2-CHP-11-SECT-2.1"/>
<h3 class="head2">Magic Script Options</h3>
<p><a href="ch11.html#samba2-CHP-11-TABLE-2">Table 11-2</a> lists the options that deal with
<a name="INDEX-20"/>magic scripts
on the Samba server.</p>
<a name="samba2-CHP-11-TABLE-2"/><h4 class="head4">Table 11-2. Magic script options</h4><table border="1">
<tr>
<th>
<p>Option</p>
</th>
<th>
<p>Parameters</p>
</th>
<th>
<p>Function</p>
</th>
<th>
<p>Default</p>
</th>
<th>
<p>Scope</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">magic</tt> <tt class="literal">script</tt></p>
</td>
<td>
<p>string (filename)</p>
</td>
<td>
<p>File to be executed by Samba, as the logged-on user, when closed</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Share</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">magic</tt> <tt class="literal">output</tt></p>
</td>
<td>
<p>string (filename)</p>
</td>
<td>
<p>File to log output from the magic file</p>
</td>
<td>
<p><em class="emphasis">scriptname.out</em></p>
</td>
<td>
<p>Share</p>
</td>
</tr>
</table>
<div class="sect3"><a name="samba2-CHP-11-SECT-2.1.1"/>
<h3 class="head3">magic script</h3>
<p>If the <tt class="literal">magic</tt><a name="INDEX-21"/>
<tt class="literal">script</tt> 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 <tt class="literal">[accounting]</tt>:</p>
<blockquote><pre class="code">[accounting]
magic script = tally.sh</pre></blockquote>
<p>Samba continually monitors the files in that share. If one by the
name of <em class="emphasis">tally.sh</em> 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 CRLFs. In addition, you
need to use the <tt class="literal">#!</tt> directive at the beginning of
the file to indicate under which shell or interpreter the script
should run, unless the script is for the default shell on your
system.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-2.1.2"/>
<a name="INDEX-22"/><h3 class="head3">magic output</h3>
<p>This option specifies an output file to which the script specified by
the <tt class="literal">magic</tt> <tt class="literal">script</tt> option will
send output. You must specify a filename in a writable directory:</p>
<blockquote><pre class="code">[accounting]
magic script = tally.sh
magic output = /var/log/magicoutput</pre></blockquote>
<p>If this option is omitted, the default output file is the name of the
script (as stated in the <tt class="literal">magic</tt>
<tt class="literal">script</tt> option) with the extension
<em class="emphasis">.out</em> appended onto it.</p>
</div>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-11-SECT-3"/>
<h2 class="head1">Internationalization</h2>
<p><a name="INDEX-23"/><a name="INDEX-24"/>Starting
with Samba 3.0, Samba supports Unicode "on the
wire," requiring no additional effort on your part
to support filenames and other text containing characters in
international character sets.</p>
<div class="sect2"><a name="samba2-CHP-11-SECT-3.1"/>
<h3 class="head2">Internationalization Options</h3>
<p>Samba 2.2.x has a limited ability to speak foreign tongues: if you
need to support filenames containing characters that
aren't in standard ASCII, some options that can help
you are shown in <a href="ch11.html#samba2-CHP-11-TABLE-3">Table 11-3</a>.</p>
<a name="samba2-CHP-11-TABLE-3"/><h4 class="head4">Table 11-3. Internationalization options</h4><table border="1">
<tr>
<th>
<p>Option</p>
</th>
<th>
<p>Parameters</p>
</th>
<th>
<p>Function</p>
</th>
<th>
<p>Default</p>
</th>
<th>
<p>Scope</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">client code</tt> <tt class="literal">page</tt></p>
</td>
<td>
<p>Described in this section</p>
</td>
<td>
<p>Sets a code page to expect from clients</p>
</td>
<td>
<p>850</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">character set</tt></p>
</td>
<td>
<p>Described in this section</p>
</td>
<td>
<p>Translates code pages into alternate Unix character sets</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">coding system</tt></p>
</td>
<td>
<p>Described in this section</p>
</td>
<td>
<p>Translates code page 932 into an Asian character set</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">valid chars</tt></p>
</td>
<td>
<p>string (set of characters)</p>
</td>
<td>
<p>Adds individual characters to a code page</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
</table>
<div class="sect3"><a name="samba2-CHP-11-SECT-3.1.1"/>
<h3 class="head3">client code page</h3>
<p>The character sets on Windows platforms hark back to the original
concept of a <em class="emphasis">code page</em><a name="INDEX-25"/>. 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
<tt class="literal">client</tt><a name="INDEX-26"/> <tt class="literal">code</tt>
<tt class="literal">page</tt> option 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 <a href="ch11.html#samba2-CHP-11-TABLE-4">Table 11-4</a>.</p>
<a name="samba2-CHP-11-TABLE-4"/><h4 class="head4">Table 11-4. Valid code pages with Samba 2.0</h4><table border="1">
<tr>
<th>
<p>Code page</p>
</th>
<th>
<p>Definition</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">437</tt></p>
</td>
<td>
<p>MS-DOS Latin (United States)</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">737</tt></p>
</td>
<td>
<p>Windows 95 Greek</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">850</tt></p>
</td>
<td>
<p>MS-DOS Latin 1 (Western European)</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">852</tt></p>
</td>
<td>
<p>MS-DOS Latin 2 (Eastern European)</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">861</tt></p>
</td>
<td>
<p>MS-DOS Icelandic</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">866</tt></p>
</td>
<td>
<p>MS-DOS Cyrillic (Russian)</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">932</tt></p>
</td>
<td>
<p>MS-DOS Japanese Shift-JIS</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">936</tt></p>
</td>
<td>
<p>MS-DOS Simplified Chinese</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">949</tt></p>
</td>
<td>
<p>MS-DOS Korean Hangul</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">950</tt></p>
</td>
<td>
<p>MS-DOS Traditional Chinese</p>
</td>
</tr>
</table>
<p>You can set the client code page as follows:</p>
<blockquote><pre class="code">[global]
client code page = 852</pre></blockquote>
<p>The default value of this option is 850, for MS-DOS Latin 1. You can
use the <em class="emphasis">make_smbcodepage</em> tool that comes with
Samba (by default in <em class="filename">/usr/local/samba/bin</em> ) to
create your own SMB code pages, in the event that those listed
earlier are not sufficient.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-3.1.2"/>
<h3 class="head3">character set</h3>
<p>The global <tt class="literal">character</tt><a name="INDEX-27"/>
<tt class="literal">set</tt> option can be used to convert filenames
offered through a DOS code page (see the previous section, <a href="ch11.html#samba2-CHP-11-SECT-3.1.1">Section 11.3.1.1</a>) 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:</p>
<blockquote><pre class="code">[global]
client code page = 850
character set = ISO8859-1</pre></blockquote>
<p>Note that you must include a <tt class="literal">client</tt>
<tt class="literal">code</tt> <tt class="literal">page</tt> option to specify the
character set from which you are converting. The valid character sets
(and their matching code pages) that Samba accepts are listed in
<a href="ch11.html#samba2-CHP-11-TABLE-5">Table 11-5</a>.</p>
<a name="samba2-CHP-11-TABLE-5"/><h4 class="head4">Table 11-5. Valid character sets</h4><table border="1">
<tr>
<th>
<p>Character set</p>
</th>
<th>
<p>Matching code page</p>
</th>
<th>
<p>Definition</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">ISO8859-1</tt></p>
</td>
<td>
<p><tt class="literal">850</tt></p>
</td>
<td>
<p>Western European Unix</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">ISO8859-2</tt></p>
</td>
<td>
<p><tt class="literal">852</tt></p>
</td>
<td>
<p>Eastern European Unix</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">ISO8859-5</tt></p>
</td>
<td>
<p><tt class="literal">866</tt></p>
</td>
<td>
<p>Russian Cyrillic Unix</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">ISO8859-7</tt></p>
</td>
<td>
<p>737</p>
</td>
<td>
<p>Greek Unix</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">KOI8-R</tt></p>
</td>
<td>
<p><tt class="literal">866</tt></p>
</td>
<td>
<p>Alternate Russian Cyrillic Unix</p>
</td>
</tr>
</table>
<p>Normally, the <tt class="literal">character</tt> <tt class="literal">set</tt>
option is disabled completely.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-3.1.3"/>
<h3 class="head3">coding system</h3>
<p>The <tt class="literal">coding</tt><a name="INDEX-28"/> <tt class="literal">system</tt>
option is similar to the <tt class="literal">character</tt>
<tt class="literal">set</tt> option. However, its purpose is to determine
how to convert a Japanese Shift JIS code page into an appropriate
Unix character set. To use this option, the <tt class="literal">client</tt>
<tt class="literal">code</tt> <tt class="literal">page</tt> option described
previously must be set to page <tt class="literal">932</tt>. The valid
coding systems that Samba accepts are listed in <a href="ch11.html#samba2-CHP-11-TABLE-6">Table 11-6</a>.</p>
<a name="samba2-CHP-11-TABLE-6"/><h4 class="head4">Table 11-6. Valid coding-system parameters</h4><table border="1">
<tr>
<th>
<p>Character set</p>
</th>
<th>
<p>Definition</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">SJIS</tt></p>
</td>
<td>
<p>Standard Shift JIS</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JIS8</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J8BB</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J8BH</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J8@B</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J8@J</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J8@H</tt></p>
</td>
<td>
<p>Eight-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JIS7</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J7BB</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J7BH</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J7@B</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J7@J</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">J7@H</tt></p>
</td>
<td>
<p>Seven-bit JIS codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JUNET</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JUBB</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JUBH</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JU@B</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JU@J</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">JU@H</tt></p>
</td>
<td>
<p>JUNET codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">EUC</tt></p>
</td>
<td>
<p>EUC codes</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">HEX</tt></p>
</td>
<td>
<p>Three-byte hexadecimal code</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">CAP</tt></p>
</td>
<td>
<p>Three-byte hexadecimal code (Columbia AppleTalk Program)</p>
</td>
</tr>
</table>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-3.1.4"/>
<h3 class="head3">valid chars</h3>
<p>The <tt class="literal">valid</tt><a name="INDEX-29"/> <tt class="literal">chars</tt> option
can be used to add individual characters to a code page. You can use
this option as follows:</p>
<blockquote><pre class="code">valid chars = Î
valid chars = 0450:0420 0x0A20:0x0A00
valid chars = A:a</pre></blockquote>
<p>Each character in the list specified should be separated by spaces.
If there is a colon between two characters or a numerical equivalent,
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, hexadecimal, or decimal Unicode equivalents.</p>
<p>If you use this option, it must be listed after the
<tt class="literal">client</tt> <tt class="literal">code</tt>
<tt class="literal">page</tt> to which you wish to add the character.
<a name="INDEX-30"/><a name="INDEX-31"/></p>
</div>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-11-SECT-4"/>
<h2 class="head1">Windows Messenger Service</h2>
<p>One of the odd features of SMB protocol is its ability to send text
messages between computers. Although both the name and functionality
are similar to that of Windows Messenger, the two are not the same.
<a name="INDEX-32"/><a name="INDEX-33"/><a name="INDEX-34"/>Windows Messenger (also called MSN
Messenger) is an Internet-oriented instant messenging service, while
Windows Messenger Service is an older and simpler LAN-oriented
service. Using the Windows Messenger Service, messages can be
addressed to users, individual computers, or entire workgroups on the
network.</p>
<p>The <a name="INDEX-35"/>WinPopup
tool (<em class="filename">Winpopup.exe</em>), shown in <a href="ch11.html#samba2-CHP-11-FIG-1">Figure 11-1</a>, can be used on Windows 95/98/Me to send or
receive messages. WinPopup is a handy tool for sending messages.
However, to receive messages, it must already be running when the
message is sent from the remote system.</p>
<div class="figure"><a name="samba2-CHP-11-FIG-1"/><img src="figs/sam2_1101.gif"/></div><h4 class="head4">Figure 11-1. Sending a message from a Windows 95/98/Me system (left); receiving a message (right)</h4>
<p>On Windows NT/2000/XP, the messenger service lets you receive
messages without having an application already running; messages will
automatically appear in a small dialog box on the screen when
received, as shown in <a href="ch11.html#samba2-CHP-11-FIG-2">Figure 11-2</a>.</p>
<div class="figure"><a name="samba2-CHP-11-FIG-2"/><img src="figs/sam2_1102.gif"/></div><h4 class="head4">Figure 11-2. Receiving a message on a Windows 2000 system</h4>
<p>To send messages, it is necessary to use the <em class="emphasis">net
send</em> command from a command-prompt window, like this:</p>
<blockquote><pre class="code">C:\> <tt class="userinput"><b>net send maya "Who's There?"</b></tt>
The message was successfully sent to MAYA.</pre></blockquote>
<div class="sect2"><a name="samba2-CHP-11-SECT-4.1"/>
<h3 class="head2">Windows Messenger Service Configuration Option</h3>
<p>Samba has a single option to handle Windows Messenger Service,
<tt class="literal">message</tt> <tt class="literal">command</tt>, as shown in
<a href="ch11.html#samba2-CHP-11-TABLE-7">Table 11-7</a>.</p>
<a name="samba2-CHP-11-TABLE-7"/><h4 class="head4">Table 11-7. Windows Messenger Service configuration option</h4><table border="1">
<tr>
<th>
<p>Option</p>
</th>
<th>
<p>Parameter</p>
</th>
<th>
<p>Function</p>
</th>
<th>
<p>Default</p>
</th>
<th>
<p>Scope</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">message</tt> <tt class="literal">command</tt></p>
</td>
<td>
<p>string (shell command)</p>
</td>
<td>
<p>Sets a command to run on Unix when a WinPopup message is received</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
</table>
<div class="sect3"><a name="samba2-CHP-11-SECT-4.1.1"/>
<h3 class="head3">message command</h3>
<p>Samba's
<tt class="literal">message</tt><a name="INDEX-36"/> <tt class="literal">command</tt>
option defines the command that will run on the server when a Windows
Messenger Service message arrives. The command will be executed as
the <tt class="literal">guest</tt> <tt class="literal">account</tt> user. What to
do with messages is questionable because most Samba hosts run as
unattended servers. One solution is to mail the messages to root like
this:</p>
<blockquote><pre class="code">[global]
message command = /bin/mail -s "SMB Message From %f on %m" root <%s; rm %s</pre></blockquote>
<p>Note the use of variables here. The <tt class="literal">%s</tt> variable
will be replaced by the name of the file in which the message
resides. This file should be deleted when the command is finished
with it; otherwise, a buildup of message files will collect on the
Samba server. In addition, the command must either exit quickly or
fork its own process (using an <tt class="literal">&</tt> after the
command); otherwise, the client might suspend and wait for
notification that the command was sent successfully before
continuing.</p>
<p>In addition to the standard variables, <a href="ch11.html#samba2-CHP-11-TABLE-8">Table 11-8</a>
shows the three unique variables that you can use in a
<tt class="literal">message</tt> <tt class="literal">command</tt>.</p>
<a name="samba2-CHP-11-TABLE-8"/><h4 class="head4">Table 11-8. message command variables</h4><table border="1">
<tr>
<th>
<p>Variable</p>
</th>
<th>
<p>Definition</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">%s</tt></p>
</td>
<td>
<p>The name of the file in which the message resides</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">%f</tt></p>
</td>
<td>
<p>The name of the system that sent the message</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">%t</tt></p>
</td>
<td>
<p>The name of the system that is the destination of the message
<a name="INDEX-37"/><a name="INDEX-38"/><a name="INDEX-39"/></p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-11-SECT-5"/>
<h2 class="head1">Miscellaneous Options</h2>
<p>Many Samba options are available to deal with operating system issues
on either Unix or Windows. In particular, some of these options are
used for setting limits for clients' use of
resources on the Unix server. The options shown in <a href="ch11.html#samba2-CHP-11-TABLE-9">Table 11-9</a> deal with some of these issues.</p>
<a name="samba2-CHP-11-TABLE-9"/><h4 class="head4">Table 11-9. Miscellaneous options</h4><table border="1">
<tr>
<th>
<p>Option</p>
</th>
<th>
<p>Parameters</p>
</th>
<th>
<p>Function</p>
</th>
<th>
<p>Default</p>
</th>
<th>
<p>Scope</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">deadtime</tt></p>
</td>
<td>
<p>numeric (minutes)</p>
</td>
<td>
<p>Number of minutes of inactivity before a connection should be
terminated.</p>
</td>
<td>
<p><tt class="literal">0</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">dfree command</tt></p>
</td>
<td>
<p>string (command)</p>
</td>
<td>
<p>Used to specify a command that returns free disk space in a format
recognized by Samba.</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">fstype</tt></p>
</td>
<td>
<p><tt class="literal">NTFS</tt>, <tt class="literal">FAT</tt>, or
<tt class="literal">Samba</tt></p>
</td>
<td>
<p>Filesystem type reported by the server to the client.</p>
</td>
<td>
<p><tt class="literal">NTFS</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">keepalive</tt></p>
</td>
<td>
<p>numeric (seconds)</p>
</td>
<td>
<p>Number of seconds between checks for an inoperative client.</p>
</td>
<td>
<p><tt class="literal">300</tt> (none)</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">max disk size</tt></p>
</td>
<td>
<p>numeric (MB)</p>
</td>
<td>
<p>Largest disk size to return to a client, some of which have limits.
Does not affect actual operations on the disk.</p>
</td>
<td>
<p><tt class="literal">0</tt> (infinity)</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">max mux</tt></p>
</td>
<td>
<p>numeric</p>
</td>
<td>
<p>Maximum number of simultaneous SMB operations that clients can make.</p>
</td>
<td>
<p><tt class="literal">50</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">max open files</tt></p>
</td>
<td>
<p>numeric</p>
</td>
<td>
<p>Limits number of open files to be below Unix limits.</p>
</td>
<td>
<p><tt class="literal">10000</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">max xmit</tt></p>
</td>
<td>
<p>numeric</p>
</td>
<td>
<p>Specifies the maximum packet size that Samba will send.</p>
</td>
<td>
<p><tt class="literal">65535</tt> or <tt class="literal">16644</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">nt pipe support</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Turns off an NT/2000/XP support feature; for benchmarking or in case
of an error.</p>
</td>
<td>
<p><tt class="literal">yes</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">nt smb support</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Turns off an NT/2000/XP support feature; for benchmarking or in case
of an error.</p>
</td>
<td>
<p><tt class="literal">yes</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">ole locking</tt> <tt class="literal">compatibility</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>Remaps out-of-range lock requests used on Windows to fit in allowable
range on Unix. Turning it off causes Unix lock errors.</p>
</td>
<td>
<p><tt class="literal">yes</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">panic action</tt></p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>Command to run if Samba server fails; for debugging.</p>
</td>
<td>
<p>None</p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">set directory</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, allows VMS clients to issue
<tt class="literal">set</tt> <tt class="literal">dir</tt> commands.</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">status</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, allows Samba to monitor status for
<tt class="literal">smbstatus</tt> command.</p>
</td>
<td>
<p><tt class="literal">yes</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">strict sync</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">no</tt>, ignores Windows application requests to
perform a sync-to-disk.</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">sync always</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, forces all client writes to be committed
to disk before returning from the call.</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">strip dot</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, strips trailing dots from Unix filenames.</p>
</td>
<td>
<p><tt class="literal">no</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">change notify timeout</tt></p>
</td>
<td>
<p>numeric (seconds)</p>
</td>
<td>
<p>Interval between checks when a client asks to wait for a change in a
specified directory.</p>
</td>
<td>
<p><tt class="literal">60</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">stat cache</tt></p>
</td>
<td>
<p>Boolean</p>
</td>
<td>
<p>If <tt class="literal">yes</tt>, Samba will cache recent name mappings.</p>
</td>
<td>
<p><tt class="literal">yes</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">stat cache size</tt></p>
</td>
<td>
<p>numeric</p>
</td>
<td>
<p>Number of entries in the stat cache.</p>
</td>
<td>
<p><tt class="literal">50</tt></p>
</td>
<td>
<p>Global</p>
</td>
</tr>
</table>
<div class="sect2"><a name="samba2-CHP-11-SECT-5.1"/>
<a name="INDEX-40"/><h3 class="head2">deadtime</h3>
<p>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
no data is being sent from it. The default value for this option is
0, which means that Samba never closes any connection, regardless of
how long they have been inactive. This can lead to unnecessary
consumption of the server's resources by inactive
clients. We recommend that you override the default as follows:</p>
<blockquote><pre class="code">[global]
deadtime = 10</pre></blockquote>
<p>This tells Samba to terminate any inactive client sessions after 10
minutes. For most networks, setting this option as such will not
inconvenience users because reconnections from the client are
generally performed transparently to the user. See also the
<tt class="literal">keepalive</tt> parameter.</p>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.1"/>
<a name="INDEX-41"/><h3 class="head3">dfree command</h3>
<p>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:</p>
<blockquote><pre class="code">[global]
dfree command = /usr/local/bin/dfree</pre></blockquote>
<p>This option should point to a script that returns the total disk
space in a block and the number of available blocks. The Samba
documentation recommends the following as a usable script:</p>
<blockquote><pre class="code">#!/bin/sh
df $1 | tail -1 | awk '{print $2" "$4}'</pre></blockquote>
<p>On System V machines, the following will work:</p>
<blockquote><pre class="code">#!/bin/sh
/usr/bin/df $1 | tail -1 | awk '{print $3" "$5}'</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.2"/>
<a name="INDEX-42"/><h3 class="head3">fstype</h3>
<p>This share-level option sets the type of filesystem that Samba
reports when queried by the client. Three strings can be used as a
value to this configuration option, as listed in <a href="ch11.html#samba2-CHP-11-TABLE-10">Table 11-10</a>.</p>
<a name="samba2-CHP-11-TABLE-10"/><h4 class="head4">Table 11-10. Filesystem types</h4><table border="1">
<tr>
<th>
<p>Value</p>
</th>
<th>
<p>Definition</p>
</th>
</tr>
<tr>
<td>
<p>NTFS</p>
</td>
<td>
<p>Microsoft Windows NT filesystem</p>
</td>
</tr>
<tr>
<td>
<p>FAT</p>
</td>
<td>
<p>DOS FAT filesystem</p>
</td>
</tr>
<tr>
<td>
<p>Samba</p>
</td>
<td>
<p>Samba filesystem</p>
</td>
</tr>
</table>
<p>The default value for this option is <tt class="literal">NTFS</tt>, 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 the default
value per share as follows:</p>
<blockquote><pre class="code">[data]
fstype = FAT</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.3"/>
<a name="INDEX-43"/><h3 class="head3">keepalive</h3>
<p>This global option specifies the number of seconds that Samba waits
between sending NetBIOS <em class="emphasis">keepalive packets</em>. 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
<tt class="literal">300</tt> (5 minutes), which you can override as
follows:</p>
<blockquote><pre class="code">[global]
keepalive = 600</pre></blockquote>
<p>The value of <tt class="literal">600</tt> (10 minutes) is good for networks
populated by reliable clients. If your network contains relatively
unreliable clients, you might prefer to set
<tt class="literal">keepalive</tt> to a lower value, such as
<tt class="literal">30</tt>. If <tt class="literal">keepalive</tt> is set to 0,
no NetBIOS keepalive packets will be sent. See also the
<tt class="literal">deadtime</tt> parameter.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.4"/>
<a name="INDEX-44"/><h3 class="head3">max disk size</h3>
<p>This global option specifies an illusory limit, in megabytes, for
each share that Samba is offering. It only affects how much disk
space Samba reports the share as having and does not prevent more
disk space from actually being available for use. You would typically
set this option to prevent clients with older operating
systems—or running buggy applications—from being confused
by large disk spaces. For example, some older Windows applications
become confused when they encounter a share larger than 1 gigabyte.
To work around this problem, <tt class="literal">max</tt>
<tt class="literal">disk</tt> <tt class="literal">size</tt> can be set as
follows:</p>
<blockquote><pre class="code">[global]
max disk size = 1000</pre></blockquote>
<p>The default value for this option is <tt class="literal">0</tt>, which
means there is no upper limit.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.5"/>
<a name="INDEX-45"/><h3 class="head3">max mux</h3>
<p>This global option specifies the maximum number of concurrent SMB
operations Samba allows. The default value for this option is
<tt class="literal">50</tt>. You can override it as follows:</p>
<blockquote><pre class="code">[global]
max mux = 100</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.6"/>
<a name="INDEX-46"/><h3 class="head3">max open files</h3>
<p>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 <tt class="literal">10000</tt>. You can override it as
follows:</p>
<blockquote><pre class="code">[global]
max open files = 8000</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.7"/>
<a name="INDEX-47"/><h3 class="head3">max xmit</h3>
<p>This global option sets the maximum size of packets that Samba
exchanges with a client. In rare cases, setting a smaller maximum
packet size can increase performance, especially with Windows for
Workgroups. In Samba versions up to 2.2.5, the default value for this
option is <tt class="literal">65535</tt>. In 2.2.7 and later versions, the
default was changed to <tt class="literal">16644</tt> to match the behavior
of Windows 2000 and improve support for Windows NT 4.0. You can
override the default as follows:</p>
<blockquote><pre class="code">[global]
max xmit = 4096</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.8"/>
<a name="INDEX-48"/><h3 class="head3">nt pipe support</h3>
<p>This global option is used by developers to allow or disallow Windows
NT/2000/XP clients the ability to make connections to
<a name="INDEX-49"/>NT-specific SMB IPC$ pipes. As a user, you
should never need to override the default:</p>
<blockquote><pre class="code">[global]
nt pipe support = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.9"/>
<a name="INDEX-50"/><h3 class="head3">nt smb support</h3>
<p>This global option is used by developers to negotiate NT-specific SMB
options with Windows NT/2000/XP clients. The Samba Team has
discovered that slightly better performance comes from setting this
value to <tt class="literal">no</tt>. However, as a user, you should
probably not override the default:</p>
<blockquote><pre class="code">[global]
nt smb support = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.10"/>
<a name="INDEX-51"/><h3 class="head3">ole locking compatibility</h3>
<p>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 <tt class="literal">yes</tt>. If you trust
your Unix locking mechanisms, you can override it as follows:</p>
<blockquote><pre class="code">[global]
ole locking compatibility = no</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.11"/>
<a name="INDEX-52"/><h3 class="head3">panic action</h3>
<p>This global option specifies a command to execute in the event that
Samba encounters a fatal error when loading or running. There is no
default value for this option. You can specify an action as follows:</p>
<blockquote><pre class="code">[global]
panic action = /bin/csh -c
'xedit <<: "Samba has shutdown unexpectedly";:'</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.12"/>
<a name="INDEX-53"/><h3 class="head3">set directory</h3>
<p>This Boolean share-level option allows <a name="INDEX-54"/>Digital Pathworks clients to
use the <em class="emphasis">setdir</em> 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 <tt class="literal">no</tt>. You can override it per share as
follows:</p>
<blockquote><pre class="code">[data]
set directory = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.13"/>
<a name="INDEX-55"/><h3 class="head3">status</h3>
<p>This global option indicates whether Samba should log all active
connections to a status file. This file is used only by the
<em class="emphasis">smbstatus</em> command. If you have no intentions of
using this command, you can set this option to <tt class="literal">no</tt>,
which can result in a small increase of speed on the server. The
default value for this option is <tt class="literal">yes</tt>. You can
override it as follows:</p>
<blockquote><pre class="code">[global]
status = no</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.14"/>
<a name="INDEX-56"/><h3 class="head3">strict sync</h3>
<p>This share-level option determines whether Samba honors all requests
to perform a disk sync when requested to do so by a client. Many
Windows clients request a disk sync when they are really just trying
to flush data to their own open files. In this case, a disk sync is
generally unnecessary on Unix due to its high reliability, and it
mostly has the effect of substantially reducing the performance of
the Samba host system. The default value for this option is
<tt class="literal">no</tt>, which allows the superfluous disk sync
requests to be ignored. You can override the default as follows:</p>
<blockquote><pre class="code">[data]
strict sync = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.15"/>
<a name="INDEX-57"/><h3 class="head3">sync always</h3>
<p>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
<tt class="literal">no</tt>, clients can request a disk synchronization;
see the earlier <tt class="literal">strict</tt> <tt class="literal">sync</tt>
option. The default value for this option is <tt class="literal">no</tt>.
You can override it per share as follows:</p>
<blockquote><pre class="code">[data]
sync always = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.16"/>
<a name="INDEX-58"/><h3 class="head3">strip dot</h3>
<p>This global option determines whether to remove the trailing dot from
Unix filenames that are formatted with a dot at the end. The default
value for this option is <tt class="literal">no</tt>. You can override it
per share as follows:</p>
<blockquote><pre class="code">[global]
strip dot = yes</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.17"/>
<h3 class="head3">change notify timeout</h3>
<p>The <tt class="literal">change</tt><a name="INDEX-59"/>
<tt class="literal">notify</tt> <tt class="literal">timeout</tt> global option
emulates a Windows NT/2000 SMB feature called <em class="firstterm">change
notification</em><a name="INDEX-60"/>. This allows a client to request
that a Windows NT/2000 server periodically monitor a specific
directory on a share for any changes. If changes occur, the server
will notify the client.</p>
<p>Samba performs this function for its clients at an interval that
defaults to 1 minute (60 seconds). Performing these checks too often
can slow down the server considerably; however, you can use this
option to specify an alternate time that Samba should wait between
performing checks:</p>
<blockquote><pre class="code">[global]
change notify timeout = 30</pre></blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.18"/>
<h3 class="head3">stat cache</h3>
<p>The <tt class="literal">stat</tt><a name="INDEX-61"/> <tt class="literal">cache</tt> global
option turns on caching of recent case-insensitive name mappings. The
default is <tt class="literal">yes</tt>. The Samba Team recommends that you
never change this parameter.</p>
</div>
<div class="sect3"><a name="samba2-CHP-11-SECT-5.1.19"/>
<h3 class="head3">stat cache size</h3>
<p>The <tt class="literal">stat</tt><a name="INDEX-62"/> <tt class="literal">cache</tt>
<tt class="literal">size</tt> global option sets the number of cache
entries to be used for the <tt class="literal">stat</tt>
<tt class="literal">cache</tt> option. The default here is
<tt class="literal">50</tt>. Again, the Samba Team recommends that you
never change this parameter.</p>
</div>
</div>
</div>
<hr/><h4 class="head4"><a href="toc.html">TOC</a></h4></body></html>
|