Define discrinants first.
[Samba/vfs_proxy.git] / howto.txt
blob654ad658c8b795c3116840b0f4774a9eaa90b2bd
1 Samba4 developer howto
2 ======================
4 tridge@samba.org, December 2004
6 A more up to date version of this howto can be found in the wiki 
7 at http://wiki.samba.org/index.php/Samba4/HOWTO.
9 This is a very basic document on how to setup a simple Samba4
10 server. This is aimed at developers who are already familiar with
11 Samba3 and wish to participate in Samba4 development. This is not
12 aimed at production use of Samba4.
14 .. contents::
16 Step 1: download Samba4
17 -----------------------
19 There are 2 methods of doing this:
21   method 1:  "rsync -avz samba.org::ftp/unpacked/samba_4_0_test/ samba4"
23   method 2:  "git clone git://git.samba.org/samba.git samba4; cd samba4; git checkout v4-0-test; cd .."
25 both methods will create a directory called "samba4" in the current
26 directory. If you don't have rsync or git then install one of them. 
28 Since only released versions of Samba contain a pregenerated configure script, 
29 you will have to generate it by hand::
31  $ cd samba4/source
32  $ ./autogen.sh
34 Note that the above rsync command will give you a checked out git
35 repository. So if you also have git you can update it to the latest
36 version at some future date using::
38   $ cd samba4
39   $ git pull origin v4-0-test
41 Step 2: compile Samba4
42 ----------------------
44 Recommended optional development libraries:
45 - acl and xattr development libraries
46 - gnutls
47 - readline
49 Run this::
51   $ cd samba4/source
52   $ ./configure
53   $ make proto all
55 If you have gcc 3.4 or newer, then substitute "pch" for "proto" to
56 greatly speed up the compile process (about 5x faster).
58 Step 3: install Samba4
59 ----------------------
61 Run this as a user who have permission to write to the install
62 directory (defaults to /usr/local/samba). Use --prefix option to
63 configure above to change this.
67   # make install
70 Step 4: provision Samba4
71 ------------------------
73 The "provision" step sets up a basic user database. Make sure your smbscript
74 binary is installed in a directory listed in your PATH environment variable.
75 It is presumed it's available just like any other commands from your shell.
76 Must be run as a user with permission to write to the install directory.
80   # cd source
81   # ./setup/provision --realm=YOUR.REALM --domain=YOURDOM \
82   #  --adminpass=SOMEPASSWORD --server-role='domain controller'
84 REMINDER: Add the "bin" directory of the path you installed to
85           (e.g. /usr/local/samba/bin) to your path, or the provision command
86           will not work.
88 'YOURDOM' is the NT4 style domain name. 'YOUR.REALM' is your kerberos
89 realm, which is typically your DNS domain name.
91 Step 5: Create a simple smb.conf
92 --------------------------------
94 The provisioning will create a very simple smb.conf with no shares by
95 default. You will need to update it to add at least one share. For
96 example::
98   [test]
99         path = /data/test
100         read only = no
103 Step 6: starting Samba4
104 -----------------------
106 The simplest is to just run "smbd", but as a developer you may find
107 the following more useful::
109    # smbd -i -M single
111 that means "start smbd without messages in stdout, and running a
112 single process. That mode of operation makes debugging smbd with gdb
113 particularly easy.
115 Note that now it is no longer necessary to have an instance of nmbd
116 from Samba 3 running.  If you are running any smbd or nmbd processes
117 they need to be stopped before starting smbd from Samba 4.
119 Make sure you put the bin and sbin directories from your new install
120 in your $PATH. Make sure you run the right version!
123 Step 7: testing Samba4
124 ----------------------
126 try these commands::
128   $ smbclient //localhost/test -Uadministrator%SOMEPASSWORD
130 or::
132   $ ./script/tests/test_posix.sh //localhost/test administrator SOMEPASSWORD
135 NOTE about filesystem support
136 -----------------------------
138 To use the advanced features of Samba4 you need a filesystem that
139 supports both the "user" and "system" xattr namespaces.
141 If you run Linux with a 2.6 kernel and ext3 this means you need to
142 include the option "user_xattr" in your /etc/fstab. For example::
144    /dev/hda3            /home                   ext3    user_xattr     1 1
146 You also need to compile your kernel with the XATTR and SECURITY
147 options for your filesystem. For ext3 that means you need::
149    CONFIG_EXT3_FS_XATTR=y
150    CONFIG_EXT3_FS_SECURITY=y
152 If you are running a Linux 2.6 kernel with CONFIG_IKCONFIG_PROC
153 defined you can check this with the following command::
155    $ zgrep CONFIG_EXT3_FS /proc/config.gz
157 If you don't have a filesystem with xattr support, then you can
158 simulate it by using the option::
160    posix:eadb = /usr/local/samba/eadb.tdb
162 that will place all extra file attributes (NT ACLs, DOS EAs, streams
163 etc), in that tdb. It is not efficient, and doesn't scale well, but at
164 least it gives you a choice when you don't have a modern filesystem.
166 Testing your filesystem
167 -----------------------
169 To test your filesystem support, install the 'attr' package and run
170 the following 4 commands as root::
172   # touch test.txt
173   # setfattr -n user.test -v test test.txt
174   # setfattr -n security.test -v test2 test.txt
175   # getfattr -d test.txt
176   # getfattr -n security.test -d test.txt
178 You should see output like this::
180   # file: test.txt
181   user.test="test"
182   
183   # file: test.txt
184   security.test="test2"
186 If you get any "Operation not supported" errors then it means your
187 kernel is not configured correctly, or your filesystem is not mounted
188 with the right options.
190 If you get any "Operation not permitted" errors then it probably means
191 you didn't try the test as root.
194         vim: ft=rest