1<?xml version="1.0" encoding="iso-8859-1"?> 2<!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc"> 3<chapter id="Portability"> 4<chapterinfo> 5 &author.jelmer; 6 &author.jht; 7 <!-- Some other people as well, but there were no author names in the text files this file is based on--> 8</chapterinfo> 9 10<title>Portability</title> 11 12<para> 13<indexterm><primary>platforms</primary></indexterm> 14<indexterm><primary>compatible</primary></indexterm> 15Samba works on a wide range of platforms, but the interface all the 16platforms provide is not always compatible. This chapter contains 17platform-specific information about compiling and using Samba.</para> 18 19<sect1> 20<title>HPUX</title> 21 22<para> 23<indexterm><primary>/etc/logingroup</primary></indexterm> 24<indexterm><primary>/etc/group</primary></indexterm> 25Hewlett-Packard's implementation of supplementary groups is nonstandard (for 26historical reasons). There are two group files, <filename>/etc/group</filename> and 27<filename>/etc/logingroup</filename>; the system maps UIDs to numbers using the former, but 28initgroups() reads the latter. Most system admins who know the ropes 29symlink <filename>/etc/group</filename> to <filename>/etc/logingroup</filename> 30(hard-link does not work for reasons too obtuse to go into here). initgroups() will complain if one of the 31groups you're in, in <filename>/etc/logingroup</filename>, has what it considers to be an invalid 32ID, which means outside the range <constant>[0..UID_MAX]</constant>, where <constant>UID_MAX</constant> is 3360000 currently on HP-UX. This precludes -2 and 65534, the usual <constant>nobody</constant> 34GIDs. 35</para> 36 37<para> 38If you encounter this problem, make sure the programs that are failing 39to initgroups() are run as users, not in any groups with GIDs outside the 40allowed range. 41</para> 42 43<para> 44This is documented in the HP manual pages under setgroups(2) and passwd(4). 45</para> 46 47<para> 48<indexterm><primary>gcc</primary></indexterm> 49<indexterm><primary>ANSI compiler</primary></indexterm> 50On HP-UX you must use gcc or the HP ANSI compiler. The free compiler 51that comes with HP-UX is not ANSI compliant and cannot compile Samba. 52</para> 53 54</sect1> 55 56<sect1> 57<title>SCO UNIX</title> 58 59<para> 60If you run an old version of SCO UNIX, you may need to get important 61TCP/IP patches for Samba to work correctly. Without the patch, you may 62encounter corrupt data transfers using Samba. 63</para> 64 65<para> 66The patch you need is UOD385 Connection Drivers SLS. It is available from 67SCO <ulink noescape="1" url="ftp://ftp.sco.com/">ftp.sco.com</ulink>, directory SLS, 68files uod385a.Z and uod385a.ltr.Z). 69</para> 70 71<para> 72The information provided here refers to an old version of SCO UNIX. If you require 73binaries for more recent SCO UNIX products, please contact SCO to obtain packages that are 74ready to install. You should also verify with SCO that your platform is up to date for the 75binary packages you will install. This is important if you wish to avoid data corruption 76problems with your installation. To build Samba for SCO UNIX products may 77require significant patching of Samba source code. It is much easier to obtain binary 78packages directly from SCO. 79</para> 80 81</sect1> 82 83<sect1> 84<title>DNIX</title> 85 86<para> 87DNIX has a problem with seteuid() and setegid(). These routines are 88needed for Samba to work correctly, but they were left out of the DNIX 89C library for some reason. 90</para> 91 92<para> 93For this reason Samba by default defines the macro NO_EID in the DNIX 94section of includes.h. This works around the problem in a limited way, 95but it is far from ideal, and some things still will not work right. 96</para> 97 98<para> 99To fix the problem properly, you need to assemble the following two 100functions and then either add them to your C library or link them into 101Samba. Put the following in the file <filename>setegid.s</filename>: 102</para> 103 104<para><programlisting> 105 .globl _setegid 106_setegid: 107 moveq #47,d0 108 movl #100,a0 109 moveq #1,d1 110 movl 4(sp),a1 111 trap #9 112 bccs 1$ 113 jmp cerror 1141$: 115 clrl d0 116 rts 117</programlisting></para> 118 119<para> 120Put this in the file <filename>seteuid.s</filename>: 121</para> 122 123<para><programlisting> 124 .globl _seteuid 125_seteuid: 126 moveq #47,d0 127 movl #100,a0 128 moveq #0,d1 129 movl 4(sp),a1 130 trap #9 131 bccs 1$ 132 jmp cerror 1331$: 134 clrl d0 135 rts 136</programlisting></para> 137 138<para> 139After creating the files, you then assemble them using 140</para> 141 142<screen> 143&prompt;<userinput>as seteuid.s</userinput> 144&prompt;<userinput>as setegid.s</userinput> 145</screen> 146 147<para> 148which should produce the files <filename>seteuid.o</filename> and 149<filename>setegid.o</filename>. 150</para> 151 152<para> 153Next you need to add these to the LIBSM line in the DNIX section of 154the Samba Makefile. Your LIBSM line will look something like this: 155</para> 156 157<para><programlisting> 158LIBSM = setegid.o seteuid.o -ln 159</programlisting></para> 160 161<para> 162You should then remove the line: 163</para> 164 165<para><programlisting> 166#define NO_EID 167</programlisting></para> 168 169<para>from the DNIX section of <filename>includes.h</filename>.</para> 170 171</sect1> 172 173<sect1> 174<title>Red Hat Linux</title> 175 176<para> 177By default during installation, some versions of Red Hat Linux add an 178entry to <filename>/etc/hosts</filename> as follows: 179<programlisting> 180127.0.0.1 loopback "hostname"."domainname" 181</programlisting> 182</para> 183 184<para> 185<indexterm><primary>loopback interface</primary></indexterm> 186This causes Samba to loop back onto the loopback interface. 187The result is that Samba fails to communicate correctly with 188the world and therefore may fail to correctly negotiate who 189is the master browse list holder and who is the master browser. 190</para> 191 192<para> 193Corrective action: Delete the entry after the word "loopback" 194in the line starting 127.0.0.1. 195</para> 196</sect1> 197 198<sect1> 199<title>AIX: Sequential Read Ahead</title> 200<!-- From an email by William Jojo <jojowil@hvcc.edu> --> 201<para> 202Disabling sequential read ahead can improve Samba performance significantly 203when there is a relatively high level of multiprogramming (many smbd processes 204or mixed with another workload), not an abundance of physical memory or slower 205disk technology. These can cause AIX to have a higher WAIT values. Disabling 206sequential read-ahead can also have an adverse affect on other workloads in the 207system so you will need to evaluate other applications for impact. 208</para> 209 210<para> 211It is recommended to use the defaults provided by IBM, but if you experience a 212high amount of wait time, try disabling read-ahead with the following commands: 213</para> 214 215<para> 216For AIX 5.1 and earlier: <userinput>vmtune -r 0</userinput> 217</para> 218 219<para> 220For AIX 5.2 and later jfs filesystems: <userinput>ioo -o minpgahead=0</userinput> 221</para> 222 223<para> 224For AIX 5.2 and later jfs2 filesystems: <userinput>ioo -o j2_minPageReadAhead=0</userinput> 225</para> 226 227<para> 228If you have a mix of jfs and jfs2 filesystems on the same host, simply use both 229ioo commands. 230</para> 231</sect1> 232 233<sect1> 234<title>Solaris</title> 235 236<sect2> 237<title>Locking Improvements</title> 238 239<para>Some people have been experiencing problems with F_SETLKW64/fcntl 240when running Samba on Solaris. The built-in file-locking mechanism was 241not scalable. Performance would degrade to the point where processes would 242get into loops of trying to lock a file. It would try a lock, then fail, 243then try again. The lock attempt was failing before the grant was 244occurring. The visible manifestation of this was a handful of 245processes stealing all of the CPU, and when they were trussed, they would 246be stuck in F_SETLKW64 loops. 247</para> 248 249<para> 250Please check with Sun support for current patches needed to fix this bug. 251The patch revision for 2.6 is 105181-34, for 8 is 108528-19, and for 9 is 112233-04. 252After the installation of these patches, it is recommended to reconfigure 253and rebuild Samba. 254</para> 255 256<para>Thanks to Joe Meslovich for reporting this.</para> 257 258</sect2> 259 260<sect2 id="winbind-solaris9"> 261<title>Winbind on Solaris 9</title> 262<para> 263Nsswitch on Solaris 9 refuses to use the Winbind NSS module. This behavior 264is fixed by Sun in patch <ulink 265url="http://sunsolve.sun.com/search/advsearch.do?collection=PATCH&type=collections&max=50&language=en&queryKey5=112960;rev=14&toDocument=yes">112960-14</ulink>. 266</para> 267</sect2> 268</sect1> 269 270</chapter> 271