From 99bde6889d3d8b7a9e950c86c30e82662e1dacdd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 9 Sep 2003 02:58:53 +0000 Subject: syncing files from 3.0 into HEAD again (This used to be commit bca0bba209255d0effbae6a3d3b6d298f0952c3a) --- docs/htmldocs/compiling.html | 87 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 44 deletions(-) (limited to 'docs/htmldocs/compiling.html') diff --git a/docs/htmldocs/compiling.html b/docs/htmldocs/compiling.html index d8b85602d9..95cdb0f581 100644 --- a/docs/htmldocs/compiling.html +++ b/docs/htmldocs/compiling.html @@ -1,8 +1,8 @@ -Chapter 36. How to compile SAMBA

Chapter 36. How to compile SAMBA

Jelmer R. Vernooij

The Samba Team

Someone; Jerry perhaps?

22 May 2001

18 March 2003

+Chapter 36. How to compile Samba

Chapter 36. How to compile Samba

Jelmer R. Vernooij

The Samba Team

Andrew Tridgell

Samba Team

22 May 2001

18 March 2003

You can obtain the samba source from the samba website. To obtain a development version, you can download samba from CVS or using rsync. -

Access Samba source code via CVS

Introduction

+

Access Samba source code via CVS

Introduction

Samba is developed in an open environment. Developers use CVS (Concurrent Versioning System) to "checkin" (also known as "commit") new source code. Samba's various CVS branches can @@ -11,12 +11,12 @@ detailed in this chapter.

This chapter is a modified version of the instructions found at http://samba.org/samba/cvs.html -

CVS Access to samba.org

+

CVS Access to samba.org

The machine samba.org runs a publicly accessible CVS repository for access to the source code of several packages, including samba, rsync, distcc, ccache and jitterbug. There are two main ways of accessing the CVS server on this host. -

Access via CVSweb

+

Access via CVSweb

You can access the source code via your favourite WWW browser. This allows you to access the contents of individual files in the repository and also to look at the revision @@ -24,7 +24,7 @@ history and commit logs of individual files. You can also ask for a diff listing between any two versions on the repository.

Use the URL : http://samba.org/cgi-bin/cvsweb -

Access via cvs

+

Access via cvs

You can also access the source code via a normal cvs client. This gives you much more control over what you can do with the repository and allows you to checkout whole source trees @@ -74,7 +74,7 @@ on this system just substitute the correct package name the following command from within the samba directory:

cvs update -d -P -

Accessing the samba sources via rsync and ftp

+

Accessing the samba sources via rsync and ftp

pserver.samba.org also exports unpacked copies of most parts of the CVS tree at ftp://pserver.samba.org/pub/unpacked and also via anonymous rsync at rsync://pserver.samba.org/ftp/unpacked/. I recommend using rsync rather than ftp. @@ -83,7 +83,7 @@ on this system just substitute the correct package name The disadvantage of the unpacked trees is that they do not support automatic merging of local changes like CVS does. rsync access is most convenient for an initial install. -

Verifying Samba's PGP signature

+

Verifying Samba's PGP signature

In these days of insecurity, it's strongly recommended that you verify the PGP signature for any source file before installing it. Even if you're not downloading from a mirror site, verifying PGP signatures should be a @@ -91,39 +91,43 @@ standard reflex.

With that said, go ahead and download the following files:

-$  wget http://us1.samba.org/samba/ftp/samba-2.2.8a.tar.asc
-$  wget http://us1.samba.org/samba/ftp/samba-pubkey.asc
+$ wget http://us1.samba.org/samba/ftp/samba-2.2.8a.tar.asc
+$ wget http://us1.samba.org/samba/ftp/samba-pubkey.asc
 

+ The first file is the PGP signature for the Samba source file; the other is the Samba public PGP key itself. Import the public PGP key with:

-	$ gpg --import samba-pubkey.asc
+$ gpg --import samba-pubkey.asc
 

And verify the Samba source code integrity with:

-	$ gzip -d samba-2.2.8a.tar.gz
-	$ gpg --verify samba-2.2.8a.tar.asc
+$ gzip -d samba-2.2.8a.tar.gz
+$ gpg --verify samba-2.2.8a.tar.asc
 

If you receive a message like, "Good signature from Samba Distribution Verification Key..." then all is well. The warnings about trust relationships can be ignored. An example of what you would not want to see would be: -

+

+ gpg: BAD signature from "Samba Distribution Verification Key" -

Building the Binaries

To do this, first run the program ./configure + +

Building the Binaries

+ To do this, first run the program ./configure in the source directory. This should automatically configure Samba for your operating system. If you have unusual - needs then you may wish to run

root# ./configure --help -

first to see what special options you can enable. - Then executing

root# make

will create the binaries. Once it's successfully - compiled you can use

root# make install

to install the binaries and manual pages. You can - separately install the binaries and/or man pages using

root# make installbin -

and

root# make installman -

Note that if you are upgrading for a previous version + needs then you may wish to run

root# ./configure --help
+

first to see what special options you can enable. + Then executing

root# make

will create the binaries. Once it's successfully + compiled you can use

root# make install

to install the binaries and manual pages. You can + separately install the binaries and/or man pages using

root# make installbin
+

and

root# make installman
+	

Note that if you are upgrading for a previous version of Samba you might like to know that the old versions of the binaries will be renamed with a ".old" extension. You - can go back to the previous version with

root# make revert -

if you find this version a disaster!

Compiling samba with Active Directory support

In order to compile samba with ADS support, you need to have installed + can go back to the previous version with

root# make revert
+

if you find this version a disaster!

Compiling samba with Active Directory support

In order to compile samba with ADS support, you need to have installed on your system:

  • the MIT kerberos development libraries (either install from the sources or use a package). The Heimdal libraries will not work.

  • the OpenLDAP development libraries.

If your kerberos libraries are in a non-standard location then @@ -135,16 +139,17 @@ example of what you would not want to see would be: #define HAVE_LDAP 1

If it doesn't then configure did not find your krb5 libraries or your ldap libraries. Look in config.log to figure - out why and fix it.

Installing the required packages for Debian

On Debian you need to install the following packages:

-

libkrb5-dev
krb5-user

-

Installing the required packages for RedHat

On RedHat this means you should have at least:

-

krb5-workstation (for kinit)
krb5-libs (for linking with)
krb5-devel (because you are compiling from source)

+ out why and fix it.

Installing the required packages for Debian

On Debian you need to install the following packages:

+

  • libkrb5-dev

  • krb5-user

+

Installing the required packages for RedHat

On RedHat this means you should have at least:

+

  • krb5-workstation (for kinit)

  • krb5-libs (for linking with)

  • krb5-devel (because you are compiling from source)

in addition to the standard development environment.

Note that these are not standard on a RedHat install, and you may need - to get them off CD2.

Starting the smbd and nmbd

You must choose to start smbd and nmbd either + to get them off CD2.

Starting the smbd and nmbd

You must choose to start smbd and nmbd either as daemons or from inetd. Don't try to do both! Either you can put them in inetd.conf and have them started on demand - by inetd, or you can start them as + by inetd or xinetd, + or you can start them as daemons either from the command line or in /etc/rc.local. See the man pages for details on the command line options. Take particular care to read @@ -152,7 +157,7 @@ example of what you would not want to see would be: Samba. In many cases you must be root.

The main advantage of starting smbd and nmbd using the recommended daemon method is that they will respond slightly more quickly to an initial connection - request.

Starting from inetd.conf

Note

The following will be different if + request.

Starting from inetd.conf

Note

The following will be different if you use NIS, NIS+ or LDAP to distribute services maps.

Look at your /etc/services. What is defined at port 139/tcp. If nothing is defined then add a line like this:

netbios-ssn     139/tcp

similarly for 137/udp you should have an entry like:

netbios-ns	137/udp

Next edit your /etc/inetd.conf @@ -161,12 +166,13 @@ example of what you would not want to see would be: netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd

The exact syntax of /etc/inetd.conf varies between unixes. Look at the other entries in inetd.conf - for a guide.

Note

Some unixes already have entries like netbios_ns + for a guide.

Some distributions use xinetd instead of inetd. Consult the + xinetd manual for configuration information.

Note

Some unixes already have entries like netbios_ns (note the underscore) in /etc/services. You must either edit /etc/services or /etc/inetd.conf to make them consistent. -

Note

On many systems you may need to use the - interfaces option in smb.conf to specify the IP +

Note

On many systems you may need to use the + interfaces option in smb.conf to specify the IP address and netmask of your interfaces. Run ifconfig as root if you don't know what the broadcast is for your @@ -177,8 +183,9 @@ example of what you would not want to see would be: This means you shouldn't use spaces between the options and arguments, or you should use a script, and start the script from inetd.

Restart inetd, perhaps just send - it a HUP. If you have installed an earlier version of nmbd then - you may need to kill nmbd as well.

Alternative: starting it as a daemon

To start the server as a daemon you should create + it a HUP.

+			root# killall -HUP inetd
+		

Alternative: starting it as a daemon

To start the server as a daemon you should create a script something like this one, perhaps calling it startsmb.

 		#!/bin/sh
@@ -190,12 +197,4 @@ example of what you would not want to see would be:
 		

To kill it send a kill signal to the processes nmbd and smbd.

Note

If you use the SVR4 style init system then you may like to look at the examples/svr4-startup - script to make Samba fit into that system.

Common Errors

-I'm using gcc 3 and I've compiled Samba-3 from the CVS and the -binaries are very large files (40 Mb and 20 Mb). I've the same result with ---enable-shared ? -” -

-The dwarf format used by GCC 3 for storing debugging symbols is very inefficient. -Strip the binaries, don't compile with -g or compile with -gstabs. -

+ script to make Samba fit into that system.

-- cgit