openldap/doc/guide/admin/runningslapd.sdf

136 lines
4.8 KiB
Plaintext
Raw Normal View History

1999-10-01 00:57:45 +08:00
# $OpenLDAP$
2008-02-13 15:35:23 +08:00
# Copyright 1999-2008 The OpenLDAP Foundation, All Rights Reserved.
1999-04-24 07:41:45 +08:00
# COPYING RESTRICTIONS APPLY, see COPYRIGHT.
1999-04-24 07:00:44 +08:00
H1: Running slapd
2006-12-08 13:02:21 +08:00
{{slapd}}(8) is designed to be run as a standalone service. This
allows the server to take advantage of caching, manage concurrency
issues with underlying databases, and conserve system resources.
Running from {{inetd}}(8) is {{NOT}} an option.
1999-04-24 07:00:44 +08:00
H2: Command-Line Options
2000-08-10 06:57:48 +08:00
{{slapd}}(8) supports a number of command-line options as detailed
in the manual page. This section details a few commonly used options.
2000-08-10 06:57:48 +08:00
> -f <filename>
2000-08-10 06:57:48 +08:00
This option specifies an alternate configuration file for slapd.
The default is normally {{F:/usr/local/etc/openldap/slapd.conf}}.
> -F <slapd-config-directory>
Specifies the slapd configuration directory. The default is {{F:/usr/local/etc/openldap/slapd.d}}.
If both {{EX:-f}} and {{EX:-F}} are specified, the config file will be read and converted
to config directory format and written to the specified directory.
If neither option is specified, slapd will attempt to read the default config
directory before trying to use the default config file. If a valid config
directory exists then the default config file is ignored. All of the slap tools
that use the config options observe this same behavior.
> -h <URLs>
This option specifies alternative listener configurations. The
2006-12-08 09:57:07 +08:00
default is {{EX:ldap:///}} which implies {{TERM:LDAP}} over
{{TERM:TCP}} on all interfaces on the default LDAP port 389. You
can specify specific host-port pairs or other protocol schemes (such
as {{EX:ldaps://}} or {{EX:ldapi://}}). For example, {{EX:-h
"ldaps:// ldap://127.0.0.1:666"}} will create two listeners: one
for the (non-standard) {{EX:ldaps://}} scheme on all interfaces on
the default {{EX:ldaps://}} port 636, and one for the standard
{{EX:ldap://}} scheme on the {{EX:localhost}} ({{loopback}}) interface
on port 666. Hosts may be specified using using hostnames or
{{TERM:IPv4}} or {{TERM:IPv6}} addresses. Port values must be
numeric.
> -n <service-name>
This option specifies the service name used for logging and
other purposes. The default service name is {{EX:slapd}}.
> -l <syslog-local-user>
This option specifies the local user for the {{syslog}}(8)
facility. Values can be {{EX:LOCAL0}}, {{EX:LOCAL1}}, {{EX:LOCAL2}}, ...,
and {{EX:LOCAL7}}. The default is {{EX:LOCAL4}}. This option
may not be supported on all systems.
> -u user -g group
These options specify the user and group, respectively, to run
as. {{EX:user}} can be either a user name or uid. {{EX:group}}
can be either a group name or gid.
> -r directory
This option specifies a run-time directory. slapd will
{{chroot}}(2) to this directory after opening listeners but
before reading any configuration files or initializing
any backends.
.
1999-04-24 07:00:44 +08:00
> -d <level> | ?
1999-04-24 07:00:44 +08:00
This option sets the slapd debug level to <level>. When level is a
`?' character, the various debugging levels are printed and slapd
exits, regardless of any other options you give it. Current
debugging levels are
!block table; colaligns="RL"; align=Center; \
2006-12-08 09:57:07 +08:00
title="Table 7.1: Debugging Levels"
2000-08-10 06:57:48 +08:00
Level Description
-1 enable all debugging
0 no debugging
1 trace function calls
2 debug packet handling
4 heavy trace debugging
8 connection management
16 print out packets sent and received
32 search filter processing
64 configuration file processing
128 access control list processing
256 stats log connections/operations/results
512 stats log entries sent
1024 print communication with shell backends
2048 print entry parsing debugging
!endblock
1999-04-24 07:00:44 +08:00
You may enable multiple levels by specifying the debug option
once for each desired level. Or, since debugging levels are
additive, you can do the math yourself. That is, if you want
to trace function calls and watch the config file being
processed, you could set level to the sum of those two levels
(in this case, {{EX: -d 65}}). Or, you can let slapd do the
2002-06-15 04:53:52 +08:00
math, (e.g. {{EX: -d 1 -d 64}}). Consult {{F: <ldap_log.h>}} for
more details.
1999-04-24 07:00:44 +08:00
Note: slapd must have been compiled with {{EX:-DLDAP_DEBUG}}
defined for any debugging information beyond the two stats levels
to be available.
H2: Starting slapd
1999-04-24 07:00:44 +08:00
In general, slapd is run like this:
2007-08-26 05:21:40 +08:00
> /usr/local/libexec/slapd [<option>]*
1999-04-24 07:00:44 +08:00
2007-08-26 05:21:40 +08:00
where {{F:/usr/local/libexec}} is determined by {{EX:configure}}
2000-08-10 06:57:48 +08:00
and <option> is one of the options described above (or in {{slapd}}(8)).
Unless you have specified a debugging level (including level {{EX:0}}),
slapd will automatically fork and detach itself from its controlling
terminal and run in the background.
1999-04-24 07:00:44 +08:00
H2: Stopping slapd
2006-12-08 09:57:07 +08:00
To kill off {{slapd}}(8) safely, you should give a command like this
1999-04-24 07:00:44 +08:00
> kill -INT `cat /usr/local/var/slapd.pid`
1999-04-24 07:00:44 +08:00
2000-08-10 06:57:48 +08:00
where {{F:/usr/local/var}} is determined by {{EX:configure}}.
1999-04-24 07:00:44 +08:00
2006-12-10 09:29:13 +08:00
Killing slapd by a more drastic method may cause information loss or
database corruption.