Linux Step By Steps

Compiling a Caldera Friendly Samba 2.2.0

Date Written: April 18, 2001

Written by Bill Parker

Tested on OpenLinux 2.3, should work with eServer or eDesktop

Tested on kernel 2.2.19 should work fine under 2.2.18 or less

Do these steps as root

first, if samba is running, shut it down with the following command

cd /etc/rc.d/init.d<enter>
../samba stop<enter>
../samba stop<enter> (for good measure)

use 'ps ax' to see if any smbd or nmbd processes are still floating around,
if so, use kill -9 to remove them (check with your users first though).

obtain samba-2.2.0 source tarball (www.samba.org)

unpack in /usr/local/src (that's where I usually unpack tarballs, btw)

remove samba and samba-doc rpm with

rpm -e samba<enter>
rpm -e samba-doc<enter>

rpm --rebuilddb<enter> (this rebuilds database)
updatedb<enter> (updates find database, I think)

mv /usr/sbin/smbmount /usr/sbin/smbmount.old<enter> (saves old versions of
mv /usr/sbin/smbumount /usr/sbin/smbumount.old<enter> these programs)

cd /usr/local/src/samba-2.2.0<enter>

now if this is the first time unpacking this tarball, skip down
to the line "Now to the fun part", otherwise start with 'make clean' below.

make clean<enter> (removes old object files *.o stuff)
make uninstall<enter> (removes potential stuff lying around)
rm config.cache<enter> (removes any caching directives)
cd include<enter>
rm config.h<enter>
cd ..

Now to the fun part, since I don't use ssl on my system
(I should, but that's another story), issue the following
command to configure a working 2.2.0 for your OpenLinux 2.3 box.

../configure --prefix=/usr \
--exec-prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var/log \
--libdir=/etc/samba.d \
--infodir=/usr/info \
--mandir=/usr/man \
--without-smbwrapper \
--with-smbmount \
--with-pam \
--with-privatedir=/etc/samba.d \
--with-lockdir=/var/lock/samba.d \
--with-swatdir=/usr/share/swat \
--with-sambabook=/usr/doc/samba-2.2.0<enter>

Note: if you want SSL support, add the line '--with-ssl' after the
--with-pam line. I used Les Bell's information to get OpenSSL
0.9.6a working on my linux box.

This will configure and build a make file so that it will install
on your system (I simply cut and pasted this from Doug's example,
as I hate to type).

Now, as Doug has stated, edit the Makefile with vi Makefile

Note: in Samba-2.2.0, the lines SMBLOGFILE and NMBLOGFILE have
been replaced with a single line called:

LOGBASEFILE = $(VARDIR)

Make this line look like this:

LOGFILEBASE = $(VARDIR)/samba.d

find the SBINDIR line per Doug's instructions and make
it look like this (2.0.7 or 2.2.0alpha-2):

SBINDIR = ${exec_prefix}/sbin

find the PASSWD_PROGRAM line per Doug's instructions
and make it look like this (2.0.7 or 2.2.0alpha-2):

PASSWD_PROGRAM = /usr/bin/passwd

write the file out with :wq<enter>

*** IMPORTANT NOTE ***

In Samba 2.0.7 or earlier, the log files for nmbd and smbd in
/var/log/samba were:

smbd
nmbd

In Samba-2.2.0 the names have been changed to log.smbd and log.nmbd

When this version is installed, it will make log files for
smbd and nmbd that look like this in /var/log/samba.d:

log.smbd
log.nmbd

for those of you who do NOT like this behavior, you will need to
modify the following files:

in <path>/source/nmbd/nmbd.c (where <path> is where you unpacked the tarball)

change line 671 from this:

slprintf(debugf, sizeof(debugf), "%s/log.nmbd", LOGFILEBASE);

to

slprintf(debugf, sizeof(debugf), "%s/nmbd", LOGFILEBASE);

in <path>/source/smbd/server.c (whete <path> is where you unpacked the
tarball)

change line 629 from this:

slprintf(debugf, sizeof(debugf), "%s/log.smbd", LOGFILEBASE);

to

slprintf(debugf, sizeof(debugf), "%s/smbd", LOGFILEBASE);

*** IMPORTANT NOTE ENDS ***

then type the following (actually building the binaries):

make<enter> (this will compile the whole thing from scratch)
make install<enter> (this will put everything where it is supposed to go)
ldconfig<enter> (I think this updates the system run time link bindings)
ldconfig -v<enter> (to list bindings)

Now in Doug's instructions, it says to make the following lines point to

a. Change /usr/sbin/smbd to /usr/bin/smbd
b. Change /usr/sbin/nmbd to /usr/bin/nmbd

Now, on my system, I find this is not needed, since smbd and nmbd
are installed in /usr/sbin (at least that's where I see them at).

run updatedb again to update the find database

Now the moment of truth :)

cd /etc/rc.d/init.d<enter>

issue the following

../samba start<enter>

and you should get back from the system:

Starting samba: smbd nmbd.

and if you do ps ax<enter> you should see lines like this:

31074 ? S 0:00 smbd -D -d1
31076 ? S 0:00 nmbd -D -d1
31077 ? S 0:00 nmbd -D -d1

in your process list

and if you check /var/log/samba.d/smbd and nmbd you should see this:

[2001/02/07 23:00:05, 1] smbd/server.c:main(641)
smbd version 2.0.7 started (or 2.2.0alpha-2)
Copyright Andrew Tridgell 1992-1998

[2001/02/07 23:00:06, 0] nmbd/asyncdns.c:start_async_dns(150)
started asyncdns process 31077

and if so, the last thing to do is to test to see if you can
connect to the linux box from a win9x/ME/NT/2000 machine.

Important note, I posted a notice about not being able to figure out why
nmbd and smbd were not showing up in the process list, and someone on IRC
suggested the use of strace /usr/sbin/smbd<enter> to see exactly what
was going on, and the listing revealed it was trying to access log files
and smb.conf in the wrong place, so this is a useful tool to have, if you
have a program which appears to die for no reason what so ever.

-Bill