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