2 # Copyright 1999-2000, The OpenLDAP Foundation, All Rights Reserved.
3 # COPYING RESTRICTIONS APPLY, see COPYRIGHT.
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.
17 H2: Command-Line Options
19 {{I:Slapd}} supports the following command-line options.
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
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
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.
47 Note: slapd must have been compiled with {{EX:-DLDAP_DEBUG}}
48 defined for any debugging information beyond the two stats levels
53 This option specifies an alternate configuration file for slapd.
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.
63 This option specifies an alternate TCP port on which slapd should
64 listen for connections. The default port is 389.
68 H2: Running slapd as a Stand-Alone Daemon
70 In general, slapd is run like this:
72 E: $(ETCDIR)/slapd [<option>]*
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.
82 To kill off slapd safely, you should give a command like this
84 E: kill -TERM `cat $(ETCDIR)/slapd.pid`
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}}.
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}}.
102 H2: Running slapd from inetd
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
110 Step 1 is to add a line like this to your {{EX: /etc/services}} file:
112 E: ldap 389 # ldap directory service
114 Step 2 is to add a line like this to your /etc/inetd.conf file:
116 E: ldap stream tcp nowait nobody $(ETCDIR)/slapd slapd -i
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.