]> git.sur5r.net Git - openldap/blob - doc/guide/admin/runningslapd.sdf
Mostly formating changes, use of classes
[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 can be run in two different modes, stand-alone or from
7 inetd(8). Stand-alone operation is recommended, especially if you
8 are using the LDBM backend. This allows the backend to take
9 advantage of caching and avoids concurrency problems with the
10 LDBM index files. If you are running only a PASSWD or SHELL
11 backend, running from inetd is an option. How to do this is
12 described in the next section, after the command-line options and
13 stand-alone daemon operation are described.
14
15
16
17 H2: Command-Line Options
18
19 {{I:Slapd}} supports the following command-line options.
20
21 E: -d <level> | ?
22
23 This option sets the slapd debug level to <level>. When level is a
24 `?' character, the various debugging levels are printed and slapd
25 exits, regardless of any other options you give it. Current
26 debugging levels are
27
28 E:     1 trace function calls
29 E:     2 debug packet handling
30 E:     4 heavy trace debugging
31 E:     8 connection management
32 E:    16 print out packets sent and received
33 E:    32 search filter processing
34 E:    64 configuration file processing
35 E:   128 access control list processing
36 E:   256 stats log connections/operations/results
37 E:   512 stats log entries sent
38 E:  1024 print communication with shell backends
39 E:  2048 print entry parsing debugging
40 E: 65535 enable all debugging
41
42 Debugging levels are additive. That is, if you want to trace function
43 calls and watch the config file being processed, you would set
44 level to the sum of those two levels (in this case, 65). Consult
45 {{EX: <ldap.h>}} for more details.
46
47 Note: slapd must have been compiled with {{EX:-DLDAP_DEBUG}}
48 defined for any debugging information beyond the two stats levels
49 to be available.
50
51 E: -f <filename>
52
53 This option specifies an alternate configuration file for slapd.
54
55 E: -i
56
57 This option tells slapd that it is running from inetd instead of as a
58 stand-alone server. See the next section on running slapd from
59 inetd for more details.
60
61 E: -p <port>
62
63 This option specifies an alternate TCP port on which slapd should
64 listen for connections. The default port is 389.
65
66
67
68 H2: Running slapd as a Stand-Alone Daemon
69
70 In general, slapd is run like this:
71
72 E:      $(ETCDIR)/slapd [<option>]*
73
74 where ETCDIR has the value you gave in the Make-common file
75 during the pre-build configuration, and <option> is one of the
76 options described below. Unless you have specified a debugging
77 level, slapd will automatically fork and detach itself from its
78 controlling terminal and run in the background. Any of the options
79 given above can be given to slapd to point it at a different
80 configuration file, listen on another port, etc.
81
82 To kill off slapd safely, you should give a command like this
83
84 E:      kill -TERM `cat $(ETCDIR)/slapd.pid`
85
86 Killing slapd by a more drastic method may cause its LDBM
87 databases to be corrupted, as it may need to flush various buffers
88 before it exits. Note that slapd writes its pid to a file called 
89 {{EX: slapd.pid}} in the {{EX: ETCDIR}} you configured in 
90 {{EX: Make-common}}. You can change
91 the location of this pid file by changing the {{EX: SLAPD_PIDFILE}}
92 variable in {{EX: include/ldapconfig.h.edit}}.
93
94 {{I: Slapd}} will also write its arguments to a file called 
95 {{EX: slapd.args}} in the {{EX: ETCDIR}} you configured 
96 in {{EX: Make-common}}. You can change the
97 location of the args file by changing the {{EX: SLAPD_ARGSFILE}}
98 variable in {{EX: include/ldapconfig.h.edit}}.
99
100
101
102 H2: Running slapd from inetd
103
104 First, make sure that running from {{I: inetd}}(8) is a good idea. If you
105 are using the LDBM backend, it is not. If you are in a high-volume
106 environment, the overhead of running from inetd also makes it a
107 bad idea. Otherwise, you may proceed with the two steps
108 necessary.
109
110 Step 1 is to add a line like this to your {{EX: /etc/services}} file:
111
112 E:      ldap 389 # ldap directory service
113
114 Step 2 is to add a line like this to your /etc/inetd.conf file:
115
116 E:      ldap stream tcp nowait nobody $(ETCDIR)/slapd slapd -i
117
118 where {{EX: ETCDIR}} has the value you gave it in the 
119 {{EX: Make-common}} file
120 during pre-build configuration. Finally, send inetd a HUP signal,
121 and you should be all set.
122