r13100: removed unused menu item
[samba.git] / howto.txt
1 Samba4 developer howto
2 ----------------------
3
4 tridge@samba.org, December 2004
5
6
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.
11
12
13 Step 1: download Samba4
14 -----------------------
15
16 There are 2 methods of doing this:
17
18   method 1:  "rsync -avz samba.org::ftp/unpacked/samba4 ."
19
20   method 2:  "svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0 samba4"
21
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. 
24
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:
28
29   $ cd samba4
30   $ svn up
31
32 Step 2: compile Samba4
33 ----------------------
34
35 Run this:
36
37   $ cd samba4/source
38   $ ./autogen.sh
39   $ ./configure.developer
40   $ make proto all
41
42 If you have gcc 3.4 or newer, then substitue "pch" for "proto" to
43 greatly speed up the compile process (about 5x faster).
44
45
46 Step 3: install Samba4
47 ----------------------
48
49 Run this as a user who have permission to write to the install
50 directory (defaults to /usr/local/samba). Use --prefix option to
51 configure above to change this.
52  
53   # make install
54
55
56 Step 4: provision Samba4
57 ------------------------
58
59 The "provision" step sets up a basic user database. Make sure your smbscript
60 binary is installed in a directory listed in your PATH environment variable.
61 It is presumed it's available just like any other commands from your shell.
62 Must be run as a user with permission to write to the install directory.
63
64   # cd source
65   # ./setup/provision --realm=YOUR.REALM --domain=YOURDOM --adminpass=SOMEPASSWORD
66
67 'YOURDOM' is the NT4 style domain name. 'YOUR.REALM' is your kerberos
68 realm, which is typically your DNS domain name.
69
70 Step 5: Create a simple smb.conf
71 --------------------------------
72
73 The provisioning will create a very simple smb.conf with no shares by
74 default. You will need to update it to add at least one share. For
75 example:
76
77   [test]
78         path = /data/test
79         read only = no
80
81
82 Step 6: starting Samba4
83 -----------------------
84
85 The simplest is to just run "smbd", but as a developer you may find
86 the following more useful:
87
88    # smbd -i -M single
89
90 that means "start smbd without messages in stdout, and running a
91 single process. That mode of operation makes debugging smbd with gdb
92 particularly easy.
93
94 Note that now it is no longer necessary to have an instance of nmbd
95 from Samba 3 running.  If you are running any smbd or nmbd processes
96 they need to be stopped before starting smbd from Samba 4.
97
98 Make sure you put the bin and sbin directories from your new install
99 in your $PATH. Make sure you run the right version!
100
101
102 Step 7: testing Samba4
103 ----------------------
104
105 try these commands:
106
107      $ smbclient //localhost/test -Uadministrator%SOMEPASSWORD
108     or
109      $ ./script/tests/test_posix.sh //localhost/test administrator SOMEPASSWORD
110
111
112 NOTE about filesystem support
113 -----------------------------
114
115 To use the advanced features of Samba4 you need a filesystem that
116 supports both the "user" and "system" xattr namespaces.
117
118 If you run Linux with a 2.6 kernel and ext3 this means you need to
119 include the option "user_xattr" in your /etc/fstab. For example:
120
121 /dev/hda3               /home                   ext3    user_xattr     1 1
122
123 You also need to compile your kernel with the XATTR and SECURITY
124 options for your filesystem. For ext3 that means you need:
125
126    CONFIG_EXT3_FS_XATTR=y
127    CONFIG_EXT3_FS_SECURITY=y
128
129 If you are running a Linux 2.6 kernel with CONFIG_IKCONFIG_PROC
130 defined you can check this with the following command:
131
132    $ zgrep CONFIG_EXT3_FS /proc/config.gz
133
134 If you don't have a filesystem with xattr support, then you can
135 simulate it by using the option:
136
137    posix:eadb = /usr/local/samba/eadb.tdb
138
139 that will place all extra file attributes (NT ACLs, DOS EAs, streams
140 etc), in that tdb. It is not efficient, and doesn't scale well, but at
141 least it gives you a choice when you don't have a modern filesystem.
142
143 Testing your filesystem
144 -----------------------
145
146 To test your filesystem support, install the 'attr' package and run
147 the following 4 commands as root:
148
149   # touch test.txt
150   # setfattr -n user.test -v test test.txt
151   # setfattr -n security.test -v test2 test.txt
152   # getfattr -d test.txt
153   # getfattr -n security.test -d test.txt
154
155 You should see output like this:
156
157   # file: test.txt
158   user.test="test"
159
160   # file: test.txt
161   security.test="test2"
162
163 If you get any "Operation not supported" errors then it means your
164 kernel is not configured correctly, or your filesystem is not mounted
165 with the right options.
166
167 If you get any "Operation not permitted" errors then it probably means
168 you didn't try the test as root.
169
170