]> git.sur5r.net Git - openldap/blob - doc/guide/admin/runningslapd.sdf
Another typo, mistake in previous commit
[openldap] / doc / guide / admin / runningslapd.sdf
1 # $OpenLDAP$
2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4 H1: Running slapd
5
6 {{slapd}}(8) is designed to be run as a stand-alone server.  This allows
7 the server to take advantage of caching, manage concurrency issues
8 with underlying databases, and conserve system resources.  Running
9 from {{inetd}}(8) is {{NOT}} an option.
10
11
12 H2: Command-Line Options
13
14 {{slapd}}(8) supports a number of command-line options as detailed
15 in the manual page.  This section details a few commonly used options.
16
17 >       -f <filename>
18
19 This option specifies an alternate configuration file for slapd.
20 The default is normally {{F:/usr/local/etc/openldap/slapd.conf}}.
21
22 >       -h <URLs>
23
24 This option specifies alternative listener configurations.  The
25 default is {{EX:ldap:///}} which implies LDAP over TCP on all
26 interfaces on the default LDAP port 389.  You can specify
27 specific host-port pairs or other protocol schemes (such as
28 ldaps:// or ldapi://).  For example,
29 {{EX:-h "ldaps:// ldap://127.0.0.1:666"}} will create
30 two listeners: one for LDAP over SSL on all interfaces on
31 the default LDAP/SSL port 636, and one for LDAP over TCP on
32 the {{EX:localhost}} ({{loopback}}) interface on port 666.
33 Hosts may be specified using IPv4 dotted-decimal form or
34 using host names.  Port values must be numeric.
35
36 >       -n <service-name>
37
38 This option specifies the service name used for logging and
39 other purposes.  The default service name is {{EX:slapd}}.
40
41 >       -l <syslog-local-user>
42
43 This option specifies the local user for the {{syslog}}(8)
44 facility.  Values can be {{EX:LOCAL0}}, {{EX:LOCAL1}}, {{EX:LOCAL2}}, ...,
45 and {{EX:LOCAL7}}.  The default is {{EX:LOCAL4}}.  This option
46 may not be supported on all systems.
47
48 >       -u user -g group
49
50 These options specify the user and group, respectively, to run
51 as.  {{EX:user}} can be either a user name or uid.  {{EX:group}}
52 can be either a group name or gid.
53
54 >       -r directory
55
56 This option specifies a run-time directory.  slapd will
57 {{chroot}}(2) to this directory after opening listeners but
58 before reading any configuration files or initializing
59 any backends.
60 .
61
62 >       -d <level> | ?
63
64 This option sets the slapd debug level to <level>. When level is a
65 `?' character, the various debugging levels are printed and slapd
66 exits, regardless of any other options you give it. Current
67 debugging levels are
68
69 !block table; colaligns="RL"; align=Center; \
70         title="Table 6.1: Debugging Levels"
71 Level   Description
72 -1      enable all debugging
73 0       no debugging
74 1       trace function calls
75 2       debug packet handling
76 4       heavy trace debugging
77 8       connection management
78 16      print out packets sent and received
79 32      search filter processing
80 64      configuration file processing
81 128     access control list processing
82 256     stats log connections/operations/results
83 512     stats log entries sent
84 1024    print communication with shell backends
85 2048    print entry parsing debugging
86 !endblock
87
88 You may enable multiple levels by specifying the debug option
89 once for each desired level.  Or, since debugging levels are
90 additive, you can do the math yourself. That is, if you want
91 to trace function calls and watch the config file being
92 processed, you could set level to the sum of those two levels
93 (in this case, {{EX: -d 65}}).  Or, you can let slapd do the
94 math, (e.g. {{EX: -d 1 -d 64}}).  Consult {{F: <ldap.h>}} for
95 more details.
96
97 Note: slapd must have been compiled with {{EX:-DLDAP_DEBUG}}
98 defined for any debugging information beyond the two stats levels
99 to be available.
100
101
102 H2: Starting slapd
103
104 In general, slapd is run like this:
105
106 >       /usr/local/etc/libexec/slapd [<option>]*
107
108 where {{F:/usr/local/etc/libexec}} is determined by {{EX:configure}}
109 and <option> is one of the options described above (or in {{slapd}}(8)).
110 Unless you have specified a debugging level (including level {{EX:0}}),
111 slapd will automatically fork and detach itself from its controlling
112 terminal and run in the background.
113
114 H2: Stopping slapd
115
116 To kill off slapd safely, you should give a command like this
117
118 >       kill -INT `cat /usr/local/var/slapd.pid`
119
120 where {{F:/usr/local/var}} is determined by {{EX:configure}}.
121
122 Killing slapd by a more drastic method may cause information
123 loss or database corruption.