1.3. About the setup-ds-admin.pl Script

The Directory Server and Admin Server instances are created and configured through a script call setup-ds-admin.pl. The Directory Server alone can be created using the setup-ds.pl script.
If simply the setup script is run, then the script launches an interactive installer which prompts for configuration settings for the Directory Server and Admin Server instances. For example:
# setup-ds-admin.pl
The setup-ds-admin.pl script can also accept a setup file or have arguments passed with the command to supply configuration information automatically.
# setup-ds-admin.pl -s -f /export/files/install.inf
setup-ds-admin.pl General.FullMachineName=ldap.example.com
Some options, such as s (silent) and f (file) allow you to supply values for the setup program through a file. The .inf file (described in more detail in Section 4.6, “Silent Setup”) has three sections for each of the major components of Directory Server: General (host server), slapd (LDAP server), and admin (Admin Server).
The same parameters specified in the .inf can be passed directly in the command line. Command-line arguments with setup-ds-admin.pl specify the .inf setup file section (General, slapd, or admin), parameter, and value in the following form:
section.parameter=value
For example, to set the machine name, suffix, and Directory Server port of the new instance, the command is as follows:
# setup-ds-admin.pl General.FullMachineName=ldap.example.com slapd.Suffix=dc=example, dc=com” slapd.ServerPort=389

Note

Passing arguments in the command line or specifying an .inf sets the defaults used in the interactive prompt unless they are used with the s (silent) option. With the s option, these values are accepted as the real settings.
Argument values containing spaces or other shell special characters must quoted to prevent the shell from interpreting them. In the previous example, the suffix value has a space character, so the entire parameter has to be quoted. If many of the parameters have to be quoted or escaped, use an .inf file instead.
An .inf file can be used in conjunction with command line parameters. Parameters set in the command line override those specified in an .inf file, which is useful for creating an .inf file to use to set up many Directory Servers. Many of the parameters can be the same, such as ConfigDirectoryLdapURL, ones specific to the host, such as FullMachineName have to be unique. For example:
# setup-ds-admin.pl -s -f common.inf General.FullMachineName=ldap37.example.com slapd.ServerIdentifier=ldap37
This command uses the common parameters specified in the common.inf file, but overrides FullMachineName and ServerIdentifier with the command line arguments.

Note

The section names and parameter names used in the .inf files and on the command line are case sensitive. See Table 1.1, “setup-ds-admin Options” to check the correct capitalization.
The .inf file has an additional option, ConfigFile which imports the contents of any LDIF file into the Directory Server. This is an extremely useful tool for preconfiguring users, replication, and other directory management entries. For more information on using the ConfigFile parameter to configure the Directory Server, see Section 4.6.4, “Using the ConfigFile Parameter to Configure the Directory Server”.
Each prompt in the installer has a default answer in square brackets, such as the following:
Would you like to continue with setup? [yes]:
Pressing Enter accepts the default answer and proceeds to the next dialog screen. Yes/No prompts accept y for Yes and n for No.

Note

To go back to a previous dialog screen, type Control-B and press Enter. You can backtrack all the way to the first screen.
When the setup-ds-admin.pl finishes, it generates a log file in the /tmp directory called setupXXXXXX.log where XXXXXX is a series of random characters. This log file contains all of the prompts and answers supplied to those prompts, except for passwords.

Table 1.1. setup-ds-admin Options

Option Alternate Options Description Example
--silent -s This sets that the setup script will run in silent mode, drawing the configuration information from a file (set with the --file parameter) or from arguments passed in the command line rather than interactively.  
--file=name -f name
This sets the path and name of the file which contains the configuration settings for the new Directory Server instance. This can be used with the --silent parameter; if used alone, it sets the default values for the setup prompts.
The .inf parameters are described in Section 4.6.5.1, “.inf File Directives”.
setup-ds-admin.pl -f /export/sample.inf
--debug -d[dddd] This parameter turns on debugging information. For the -d flag, increasing the number of d's increases the debug level.  
--keepcache -k This saves the temporary installation file (.inf) that is created when the setup script is run. This file can then be reused for a silent setup. This file is always generated, but is usually deleted once the install is complete. The file is created as a log file named /tmp/setuprandom.inf, like /tmp/setuplGCZ8H.inf.

Warning

The cache file contains the cleartext passwords supplied during setup. Use appropriate caution and protection with this file.
 
--logfile name -l This parameter specifies a log file to which to write the output. If this is not set, then the setup information is written to a temporary file.
-l /export/example2007.log
For no log file, set the file name to /dev/null:
-l /dev/null
--update -u This parameter updates existing Directory Server instances. If an installation is broken in some way, this option can be used to update or replace missing packages and then re-register all of the local instances with the Configuration Directory.