Samba for AIX: Difference between revisions

From SambaWiki
(add description how to build and install samba 4.1 on AIX)
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== How to install samba-4.1.16 on aix-6.1 ==
= How to get Samba running on AIX =


You can either compile Samba yourself or install precompiled Samba packages from third party vendors.
Joost van Baal-Ilić, credativ BV, february 2015


== Install Samba from source ==
Based upon instructions by Noël Köthe, credativ GmbH, sept 2014.


For various reasons getting Samba built on AIX can be a bit challenging. It is recommended to compile Samba with the native xlc compiler from IBM, you will need to install also a number of other third party packages first, which also depends on the features that you want to compile into your Samba binary.
We describe how to build, configure, pack/unpack and install Samba --the Open Source SMB/CIFS file, print, and login server for Unix-- version 4.1.16 on a PowerPC running IBM's AIX 6.1.


=== Building and installing ===
== Install Samba binary packages ==


Much easier than compiling Samba on AIX on your own is using pre-built binary packages from third party vendors:
* Install the IBM compiler xlc version 13.1.0. (Compiling with gcc won't work, see https://bugzilla.samba.org/show_bug.cgi?id=10828 .)
* Install python + dependencies; since Samba uses python for its build system. Likely these RPMs suffice:


* [https://samba.plus/de/samba-aix/ SAMBA+ for AIX] is a commercially supported Samba distribution for AIX 7 from SerNet
<pre>
bash-4.2-12.aix5.1.ppc.rpm
bzip2-1.0.6-1.aix5.1.ppc.rpm
db4-4.7.25-2.aix5.1.ppc.rpm
expat-2.1.0-1.aix5.1.ppc.rpm
fontconfig-2.10.2-1.aix5.1.ppc.rpm
freetype2-2.5.2-1.aix5.1.ppc.rpm
gdbm-1.11-1.aix5.1.ppc.rpm
gettext-0.17-1.aix5.1.ppc.rpm
glib2-2.38.2-1.aix5.1.ppc.rpm
gmp-5.1.3-1.aix5.1.ppc.rpm
info-5.2-1.aix5.1.ppc.rpm
libXft-2.3.1-1.aix5.1.ppc.rpm
libXrender-0.9.8-1.aix6.1.ppc.rpm
libgcc-4.8.2-1.aix7.1.ppc.rpm
libiconv-1.14-2.aix5.1.ppc.rpm
libpng-1.6.9-1.aix5.1.ppc.rpm
libstdc++-4.8.2-1.aix7.1.ppc.rpm
libstdc++-devel-4.8.2-1.aix7.1.ppc.rpm
pkg-config-0.28-1.aix5.1.ppc.rpm
python-2.7.5-1.aix6.1.ppc.rpm
python-devel-2.7.5-1.aix6.1.ppc.rpm
python-libs-2.7.5-1.aix6.1.ppc.rpm
readline-6.2-5.aix5.1.ppc.rpm
renderproto-0.11.1-1.aix5.1.ppc.rpm
sqlite-3.8.1-1.aix5.1.ppc.rpm
tcl-8.5.15-1.aix5.1.ppc.rpm
tk-8.5.15-1.aix5.1.ppc.rpm
zlib-1.2.8-1.aix5.1.ppc.rpm
</pre>


* [https://www.bullfreeware.com Bull Freeware] used to offer a lot of RPM based AIX packages, also Samba for AIX 6, but this is offering is going to be discontinued on March 2022
Install them by running:

# rpm -ivh * --nodeps

* In a directory with enough space (ideally _not_ under the install root /appl/samba), unpack the samba sources

# gunzip samba-4.1.16.tar.gz && tar -xf samba-4.1.16.tar && cd samba-4.1.16

* Build and install

# export PATH=$PATH:/opt/IBM/xlC/13.1.0/bin/

# ./configure --prefix=/appl/samba --check-c-compiler=xlc
[...]
'configure' finished successfully

# make
[...]
Compiling ...
Linking ...
'build' finished successfully

# make install
[...]
'install finished successfully'

* Fix missing symlinks to .so-files [1]:

# cd /appl/samba/lib/private/
# ls | grep "so\.[0-9]$" | while read f; do ln -s $f ${f%.?}; done
# ls | grep "so\.[0-9][0-9]$" | while read f; do ln -s $f ${f%.??}; done

See also http://bugzilla.samba.org/show_bug.cgi?id=1084 NB: this is NOT the same as Noël's script!

* Add a configuration file:

# vi /appl/samba/etc/smb.conf

This one works for tests:

<pre>
[global]
workgroup = SIM
netbios name = SERVERNAME
server string = Fileserver
security = user
;interfaces = en 192.168.1.2/24
;bind interfaces ony = yes

log level = 2
log file = /appl/samba/logs/log.%m
syslog = 0

[SHARE]
comment = production share
path = /LOCAL/EXISTING/PATH/OF/A/SHARE
read only = no
;create mask = 0775
directory mask = 775
;valid user =
;force user =
;force group =
</pre>

See also samba-4.1.16/examples/smb.conf.default .

=== Testing ===

In order to run the samba binaries, set this:

# export LIBPATH=/appl/samba/lib:/appl/samba/lib/private

Test samba:

# /appl/samba/bin/smbclient -L localhost

Add a samba user, and give this user a samba password, for more testing:

# /appl/samba/bin/smbpasswd -a <localunixusername>
[...]
"Added user [...]

Start the Samba daemon:

# /appl/samba/sbin/smbd -D

Test a user login:

# /appl/samba/bin/smbclient -U <username> //localhost/INTERFACES
smb: \> ls
[...]
smb: \> cd .snapshot
smb: \.snapshot\> ls
[...]


== Installing on another AIX 6 system ==

Create an archive of /appl/samba or copy /appl/samba to th other machine. After unpacking
this file there, and creating /appl/samba/etc/smb.conf, one can start smbd:

# export LIBPATH=/appl/samba/lib:/appl/samba/lib/private
# /appl/samba/sbin/smbd -D

No need to run ./configure or make, no need to install xlc. You _do_ need Python to run Samba.

FIXME: this installation procedure needs some more details, and needs proper testing!

[1] When these symlinks are not created, trying to run smbclient will give
an error 'Cannot load module libtevent.so.'

Latest revision as of 15:08, 12 January 2022

How to get Samba running on AIX

You can either compile Samba yourself or install precompiled Samba packages from third party vendors.

Install Samba from source

For various reasons getting Samba built on AIX can be a bit challenging. It is recommended to compile Samba with the native xlc compiler from IBM, you will need to install also a number of other third party packages first, which also depends on the features that you want to compile into your Samba binary.

Install Samba binary packages

Much easier than compiling Samba on AIX on your own is using pre-built binary packages from third party vendors:

  • SAMBA+ for AIX is a commercially supported Samba distribution for AIX 7 from SerNet
  • Bull Freeware used to offer a lot of RPM based AIX packages, also Samba for AIX 6, but this is offering is going to be discontinued on March 2022