]> git.sur5r.net Git - openldap/blob - doc/man/man8/slapd.8
28f91254a8f22ca3424257719c58e79db108f463
[openldap] / doc / man / man8 / slapd.8
1 .TH SLAPD 8C "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2009 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd \- Stand-alone LDAP Daemon
7 .SH SYNOPSIS
8 .B LIBEXECDIR/slapd 
9 [\c
10 .BR \-4 | \-6 ]
11 [\c
12 .BR \-T \ { acl \||\| a [ dd ]\||\| auth \||\| c [ at ]\||\| d [ n ]\||\| i [ ndex ]\||\| p [ asswd ]\||\| t [ est ]}]
13 [\c
14 .BI \-d \ debug-level\fR]
15 [\c
16 .BI \-f \ slapd-config-file\fR]
17 [\c
18 .BI \-F \ slapd-config-directory\fR]
19 [\c
20 .BI \-h \ URLs\fR]
21 [\c
22 .BI \-n \ service-name\fR]
23 [\c
24 .BI \-s \ syslog-level\fR]
25 [\c
26 .BI \-l \ syslog-local-user\fR]
27 [\c
28 .BI \-o \ option\fR[ = value\fR]]
29 [\c
30 .BI \-r \ directory\fR]
31 [\c
32 .BI \-u \ user\fR]
33 [\c
34 .BI \-g \ group\fR]
35 [\c
36 .BI \-c \ cookie\fR]
37 .SH DESCRIPTION
38 .LP
39 .B Slapd
40 is the stand-alone LDAP daemon. It listens for LDAP connections on
41 any number of ports (default \fB389\fP), responding
42 to the LDAP operations it receives over these connections.
43 .B slapd
44 is typically invoked at boot time, usually out of
45 .BR  /etc/rc.local .
46 Upon startup,
47 .B slapd
48 normally forks and disassociates itself from the invoking tty.
49 If configured in the config file (or config directory),
50 the
51 .B slapd
52 process will print its process ID (see
53 .BR getpid (2))
54 to a 
55 .B .pid
56 file, as well as the command line options during invocation to an
57 .B .args
58 file (see 
59 .BR slapd.conf (5)).
60 If the
61 .B \-d
62 flag is given, even with a zero argument,
63 .B slapd
64 will not fork and disassociate from the invoking tty.
65 .LP
66 See the "OpenLDAP Administrator's Guide" for more details on
67 .BR slapd .
68 .SH OPTIONS
69 .TP
70 .B \-4
71 Listen on IPv4 addresses only.
72 .TP
73 .B \-6
74 Listen on IPv6 addresses only.
75 .TP
76 .BR \-T \ { acl \||\| a [ dd ]\||\| auth \||\| c [ at ]\||\| d [ n ]\||\| i [ ndex ]\||\| p [ asswd ]\||\| t [ est ]}
77 Run in Tool mode. The additional argument selects whether to run as
78 .IR slapadd ,
79 .IR slapcat ,
80 .IR slapdn ,
81 .IR slapindex ,
82 .IR slappasswd ,
83 or
84 .I slaptest
85 (\fIslapacl\fP and \fIslapauth\fP need the entire \fBacl\fP and \fBauth\fP
86 option value to be spelled out, as \fBa\fP is reserved to
87 .IR slapadd ).
88 This option should be the first option specified when it is used;
89 any remaining options will be interpreted by the corresponding 
90 slap tool program, according to the respective man pages.
91 Note that these tool programs will usually be symbolic links to
92 .BR slapd .
93 This option is provided for situations where symbolic links 
94 are not provided or not usable.
95 .TP
96 .BI \-d \ debug-level
97 Turn on debugging as defined by
98 .IR debug-level .
99 If this option is specified, even with a zero argument,
100 .B slapd
101 will not fork or disassociate from the invoking terminal.  Some general
102 operation and status messages are printed for any value of \fIdebug-level\fP.
103 \fIdebug-level\fP is taken as a bit string, with each bit corresponding to a
104 different kind of debugging information.  See <ldap_log.h> for details.
105 Comma-separated arrays of friendly names can be specified to select
106 debugging output of the corresponding debugging information.
107 All the names recognized by the \fIloglevel\fP directive 
108 described in \fBslapd.conf\fP(5) are supported.
109 If \fIdebug-level\fP is \fB?\fP, a list of installed debug-levels is printed,
110 and slapd exits.
111
112 Remember that if you turn on packet logging, packets containing bind passwords
113 will be output, so if you redirect the log to a logfile, that file should
114 be read-protected.
115 .TP
116 .BI \-s \ syslog-level
117 This option tells
118 .B slapd
119 at what debug-level debugging statements should be logged to the
120 .BR syslog (8)
121 facility.
122 The value \fIsyslog-level\fP can be set to any value or combination
123 allowed by the \fB\-d\fP switch.
124 Slapd logs all messages selected by \fIsyslog-leveli\fP 
125 at the
126 .BR syslog (3)
127 severity debug-level \fBDEBUG\fP,
128 on the unit specified with \fB\-l\fP.
129 .TP
130 .BI \-n \ service-name
131 Specifies the service name for logging and other purposes.  Defaults
132 to basename of argv[0], i.e.: "slapd".
133 .TP
134 .BI \-l \ syslog-local-user
135 Selects the local user of the
136 .BR syslog (8)
137 facility. Value can be 
138 .BR LOCAL0 , 
139 through
140 .BR LOCAL7 ,
141 as well as
142 .B USER
143 and
144 .BR DAEMON .
145 The default is
146 .BR LOCAL4 .
147 However, this option is only permitted on systems that support
148 local users with the 
149 .BR syslog (8)
150 facility.
151 Logging to syslog(8) occurs at the "DEBUG" severity debug-level.
152 .TP
153 .BI \-f \ slapd-config-file
154 Specifies the slapd configuration file. The default is
155 .BR ETCDIR/slapd.conf .
156 .TP
157 .BI \-F \ slapd-config-directory
158 Specifies the slapd configuration directory. The default is
159 .BR ETCDIR/slapd.d .
160 If both
161 .B \-f
162 and
163 .B \-F
164 are specified, the config file will be read and converted to
165 config directory format and written to the specified directory.
166 If neither option is specified, slapd will attempt to read the
167 default config directory before trying to use the default
168 config file. If a valid config directory exists then the
169 default config file is ignored. All of the slap tools that
170 use the config options observe this same behavior.
171 .TP
172 .BI \-h \ URLlist
173 .B slapd
174 will by default serve
175 .B ldap:///
176 (LDAP over TCP on all interfaces on default LDAP port).  That is, 
177 it will bind using INADDR_ANY and port \fB389\fP.
178 The
179 .B \-h
180 option may be used to specify LDAP (and other scheme) URLs to serve.
181 For example, if slapd is given
182 .BR "\-h \(dqldap://127.0.0.1:9009/ ldaps:/// ldapi:///\(dq" , 
183 it will listen on 127.0.0.1:9009 for LDAP, 0.0.0.0:636 for LDAP over TLS,
184 and LDAP over IPC (Unix domain sockets).  Host 0.0.0.0 represents
185 INADDR_ANY (any interface).
186 A space separated list of URLs is expected.  The URLs should be of
187 the LDAP, LDAPS, or LDAPI schemes, and generally
188 without a DN or other optional parameters (excepting as discussed below).
189 Support for the latter two schemes depends on selected configuration 
190 options.  Hosts may be specified by name or IPv4 and IPv6 address formats.
191 Ports, if specified, must be numeric.  The default ldap:// port is \fB389\fP
192 and the default ldaps:// port is \fB636\fP.
193
194 The listener permissions are indicated by
195 "x\-mod=\-rwxrwxrwx", "x\-mod=0777" or "x\-mod=777", where any 
196 of the "rwx" can be "\-" to suppress the related permission, while any 
197 of the "7" can be any legal octal digit, according to chmod(1).
198 The listeners can take advantage of the "x\-mod"
199 extension to apply rough limitations to operations, e.g. allow read operations
200 ("r", which applies to search and compare), write operations ("w", 
201 which applies to add, delete, modify and modrdn), and execute operations
202 ("x", which means bind is required).
203 "User" permissions apply to authenticated users, while "other" apply
204 to anonymous users; "group" permissions are ignored.
205 For example, "ldap:///????x\-mod=\-rw\-\-\-\-\-\-\-" means that read and write is only allowed
206 for authenticated connections, and bind is required for all operations.
207 This feature is experimental, and requires to be manually enabled
208 at configure time.
209 .TP
210 .BI \-r \ directory
211 Specifies a directory to become the root directory.  slapd will
212 change the current working directory to this directory and
213 then
214 .BR chroot (2)
215 to this directory.  This is done after opening listeners but before
216 reading any configuration file or initializing any backend.  When
217 used as a security mechanism, it should be used in conjunction with
218 .B \-u
219 and
220 .B \-g
221 options.
222 .TP
223 .BI \-u \ user
224 .B slapd
225 will run slapd with the specified user name or id, and that user's
226 supplementary group access list as set with initgroups(3).  The group ID
227 is also changed to this user's gid, unless the \fB\-g\fP option is used to
228 override.  Note when used with
229 .BR \-r ,
230 slapd will use the user database in the change root environment.
231
232 Note that on some systems, running as a non-privileged user will prevent
233 passwd back-ends from accessing the encrypted passwords.  Note also that
234 any shell back-ends will run as the specified non-privileged user.
235 .TP
236 .BI \-g \ group
237 .B slapd
238 will run with the specified group name or id.  Note when used with
239 .BR \-r ,
240 slapd will use the group database in the change root environment.
241 .TP
242 .BI \-c \ cookie
243 This option provides a cookie for the syncrepl replication consumer.
244 The cookie is a comma separated list of \fIname=value\fP pairs.
245 Currently supported syncrepl cookie fields are
246 .BR rid ,
247 .BR sid ,
248 and
249 .BR csn .
250 .B rid
251 identifies a replication thread within the consumer server
252 and is used to find the syncrepl specification in 
253 .BR slapd.conf (5)
254 or
255 .BR slapd\-config (5)
256 having the matching replication identifier in its definition. The
257 .B rid
258 must be provided in order for any other specified values to be used.
259 .B sid
260 is the server id in a multi-master/mirror-mode configuration.
261 .B csn
262 is the commit sequence number received by a previous synchronization
263 and represents the state of the consumer replica content which the
264 syncrepl engine will synchronize to the current provider content.
265 In case of \fImirror-mode\fP or \fImulti-master\fP replication agreement,
266 multiple
267 .B csn
268 values, semicolon separated, can appear.
269 Use only the 
270 .B rid
271 part to force a full reload.
272 .TP
273 .BI \-o \ option\fR[ = value\fR]
274 This option provides a generic means to specify options without the need to reserve
275 a separate letter for them.
276
277 It supports the following options:
278 .RS
279 .TP
280 .BR slp= { on \||\| off \||\| \fIslp-attrs\fP }
281 When SLP support is compiled into slapd, disable it (\fBoff\fP),
282  enable it by registering at SLP DAs without specific SLP attributes (\fBon\fP),
283 or with specific SLP attributes
284 .I slp-attrs
285 that must be an SLP attribute list definition according to the SLP standard.
286
287 For example, \fB"slp=(tree=production),(server-type=OpenLDAP),(server\-version=2.4.15)"\fP
288 registers at SLP DAs with the three SLP attributes tree, server-type and server-version
289 that have the values given above.
290 This allows to specifically query the SLP DAs for LDAP servers holding the
291 .I production
292 tree in case multiple trees are available.
293 .RE
294 .SH EXAMPLES
295 To start 
296 .I slapd
297 and have it fork and detach from the terminal and start serving
298 the LDAP databases defined in the default config file, just type:
299 .LP
300 .nf
301 .ft tt
302         LIBEXECDIR/slapd
303 .ft
304 .fi
305 .LP
306 To start 
307 .B slapd
308 with an alternate configuration file, and turn
309 on voluminous debugging which will be printed on standard error, type:
310 .LP
311 .nf
312 .ft tt
313         LIBEXECDIR/slapd \-f /var/tmp/slapd.conf \-d 255
314 .ft
315 .fi
316 .LP
317 To test whether the configuration file is correct or not, type:
318 .LP
319 .nf
320 .ft tt
321         LIBEXECDIR/slapd \-Tt
322 .ft
323 .fi
324 .LP
325 .SH "SEE ALSO"
326 .BR ldap (3),
327 .BR slapd.conf (5),
328 .BR slapd\-config (5),
329 .BR slapd.access (5),
330 .BR slapacl (8),
331 .BR slapadd (8),
332 .BR slapauth (8),
333 .BR slapcat (8),
334 .BR slapdn (8),
335 .BR slapindex (8),
336 .BR slappasswd (8),
337 .BR slaptest (8).
338 .LP
339 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
340 .SH BUGS
341 See http://www.openldap.org/its/
342 .SH ACKNOWLEDGEMENTS
343 .so ../Project