r4775: use schema_attr_cmp wrapper to check for the special dn/distinguishedName...
[Samba/gebeck_regimport.git] / howto.txt
bloba895903d17be37511286be187647ee3e2a53235a
1 Samba4 developer howto
2 ----------------------
4 tridge@samba.org, December 2004
7 This is a very basic document on how to setup a simple Samba4
8 server. This is aimed at developers who are already familiar with
9 Samba3 and wish to participate in Samba4 development. This is not
10 aimed at production use of Samba4.
13 Step 1: download Samba4
14 -----------------------
16 There are 2 methods of doing this:
18   method 1:  "rsync -avz samba.org::ftp/unpacked/samba4 ."
20   method 2:  "svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0 samba4"
22 both methods will create a directory called "samba4" in the current
23 directory. If you don't have rsync or svn then install one of them. 
25 Note that the above rsync command will give you a checked out svn
26 repository. So if you also have svn you can update it to the latest
27 version at some future date using:
29   cd samba4
30   svn up
33 Step 2: compile Samba4
34 ----------------------
36 Run this:
38   cd samba4/source
39   ./autogen.sh
40   ./configure.developer -C
41   make
43 If you have gcc 3.4 or newer, then run "make pch" before "make" to
44 greatly speed up the compile process (about 5x faster).
47 Step 3: install Samba4
48 ----------------------
50 Run this as a user who have permission to write to the install
51 directory (defaults to /usr/local/samba). Use --prefix option to
52 configure above to change this.
54   make install
57 Step 4: provision Samba4
58 ------------------------
60 The "provision" step sets up a basic user database. 
62   cd source
63   ./script/provision.pl --realm=YOUR.REALM --domain=YOURDOM --adminpass=SOMEPASSWORD
65 This will create a file called newsam.ldb. You need to copy this to
66 sam.ldb in the "private" subdirectory of your install. For example:
68   cp newsam.ldb /usr/local/samba/private/sam.ldb
71 Step 5: Create a simple smb.conf
72 --------------------------------
74 You need to create a smb.conf file in the lib/ directory of your
75 install. The default is /usr/local/samba/lib/smb.conf. A minimal
76 smb.conf would be:
78   workgroup = YOURDOM
80   [test]
81         path = /data/test
82         read only = no
84 The workgroup must exactly match the --domain argument you gave to provision.pl
87 Step 6: starting Samba4
88 -----------------------
90 The simplest is to just run "smbd", but as a developer you may find
91 the following more useful:
93    smbd -i -M single -d3
95 that means "start smbd without messages in stdout, and running a
96 single process, with level 3 debugging". That mode of operation makes
97 debugging smbd with gdb particularly easy.
99 Make sure you put the bin and sbin directories from your new install
100 in your $PATH. Make sure you run the right version!
103 Step 7: testing Samba4
104 ----------------------
106 try these commands:
108       smbclient //localhost/test -Uadministrator%SOMEPASSWORD
109     or
110      ./script/tests/test_posix.sh //localhost/test administrator SOMEPASSWORD
113 NOTE about filesystem support
114 -----------------------------
116 To use the advanced features of Samba4 you need a filesystem that
117 supports both the "user" and "system" xattr namespaces.
119 If you run Linux with a 2.6 kernel and ext3 this means you need to
120 include the option "user_xattr" in your /etc/fstab. For example:
122 /dev/hda3               /home                   ext3    user_xattr     1 1
124 You also need to compile your kernel with the XATTR and SECURITY
125 options for your filesystem. For ext3 that means you need:
127    CONFIG_EXT3_FS_XATTR=y
128    CONFIG_EXT3_FS_SECURITY=y
130 If you don't have a filesystem with xattr support, then you can
131 simulate it by using the option:
133    posix:eadb = /usr/local/samba/eadb.tdb
135 that will place all extra file attributes (NT ACLs, DOS EAs, streams
136 etc), in that tdb. It is not efficient, and doesn't scale well, but at
137 least it gives you a choice when you don't have a modern filesystem.
139 Testing your filesystem
140 -----------------------
142 To test your filesystem support, install the 'attr' package and run
143 the following 4 commands as root:
145   touch test.txt
146   setfattr -n user.test -v test test.txt
147   setfattr -n security.test -v test2 test.txt
148   getfattr -d test.txt
149   getfattr -n security.test -d test.txt
151 You should see output like this:
153   # file: test.txt
154   user.test="test"
156   # file: test.txt
157   security.test="test2"
159 If you get any "Operation not supported" errors then it means your
160 kernel is not configured correctly, or your filesystem is not mounted
161 with the right options.
163 If you get any "Operation not permitted" errors then it probably means
164 you didn't try the test as root.