Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Open Source Middleware Stacks Blueprint:: Directory Services on HP ProLiant and HP Integrity Servers with Red Hat Linux Enterprise Version 5

Managing the Symas CDS Server

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Using CDS Server Script Options

Log in as the root user to execute the script commands.

Starting the CDS Server

To start the CDS server and verify the daemon is running, enter the following commands:

# /etc/init.d/cdsserver start

# ps –ef | grep slapd

Stopping the CDS Server

To stop the CDS server and verify the daemon has stopped running, enter the following commands:

# /etc/init.d/cdsserver stop

# ps –ef | grep slapd

Restarting the CDS Server

To restart the CDS server and verify the daemon is running, enter the following commands:

# /etc/init.d/cdsserver restart

# ps –ef | grep slapd

Checking the Status of the CDS Server

To check the CDS server status, enter the following command:

# /etc/init.d/cdsserver status

Debugging the CDS Server

To print the log of the CDS server to a single file, use the following steps:

  1. Edit the /etc/syslog.conf file by adding the following line:

    local4.* /var/log/ldap.log
  2. Restart the syslog daemon by entering:

    # /etc/init.d/syslog restart

  3. Edit the file /opt/symas/etc/openldap/slapd.conf and add the appropriate log level.

    The OpenLDAP Web site provides the following log level descriptions which can be used to determine which log level is appropriate, for example, log level 8.

    Debugging Levels
      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
      16384	  syncrepl consumer processing
    
  4. Restart the CDS server by entering the following command:

    # /etc/init.d/cdsserver restart

  5. Retrieve the basic information for function calls in the file /var/log/ldap.log

    NOTE: The resulting debug message can create very large log files in a short period of time. Therefore, use the debug option carefully and take precautions to prevent your log files from unbounded growth. Additional information on the debug levels is located at:

    http://www.openldap.org/doc/admin23/slapdconf2.html

Performing Common CDS Server Operations

This section describes some common operations of CDS clients.

NOTE: For the steps that follow, when you are prompted for a password, enter the password specified in the slapd.conf file. The default password is secret. Assume that the value of the suffix Directive in slapd.conf is "dc=example,dc=com".

Adding an Entry to the Directory

  1. Use a text editor to create an LDIF file and save it as /tmp/add.ldif, with the following content:

    dn: dc=example,dc=com
    objectClass: dcObject
    objectClass: organization
    dc: example
    o: example
    
    dn: dc=osm,dc=example,dc=com
    objectClass: dcObject
    objectClass: organizationalUnit
    dc: osm
    ou: osm
    
    dn: uid=tomy,dc=osm,dc=example,dc=com
    objectClass: inetOrgPerson
    uid: tomy
    sn: tom
    cn: tom yan
    mail: tom.yan@example.com
    carLicense: sea4321
    userPassword: tom
    NOTE: If there are any trailing spaces in the LDIF file, the ldapadd command fails.
  2. Enter the following command to add the entry to the directory:

    # /opt/symas/bin/ldapadd –x –D “cn=Manager,dc=example,dc=com”\

    –W –f /tmp/add.ldif

    Figure 2 Adding the Entries

    Adding the Entries
NOTE: For the commands listed in this and proceeding sections, the following options are used:

-D specifies the Distinguished Name (DN) that is bound to the LDAP directory.

-x specifies simple authentication.

-W specifies a prompt for the bind password (for simple authentication).

-f specifies read operations from a file.

-b specifies the base DN as the starting point for the search.

-s specifies the scope of the search. The search can be base, one or sub to specify a base object, or one-level or a subtree search.

For additional information, see the ldap man page.

Searching for an Entry in the Directory

To search for the new entry you added in the previous step, use the ldapsearch command as follows:

# /opt/symas/bin/ldapsearch -x -D "cn=Manager,dc=example,dc=com" –W \

"cn=tom yan"

Figure 3 Searching for an Entry

Searching for an Entry

Modifying an Entry in the Directory

  1. Use a text editor to create an LDIF file, saved as /tmp/modify.ldif, with the following content:

    dn: uid=tomy,dc=osm,dc=example,dc=com
    changetype: modify
    replace: mail
    mail: newmail@example.com
    -
    add: title
    title: added title
    -
    delete: carLicense
  2. Enter the following command:

    # /opt/symas/bin/ldapmodify -x -D "cn=Manager,dc=example,dc=com" \

    -W -f /tmp/modify.ldif

    Figure 4 Modifying an Entry

    Modifying an Entry
  3. To verify the modification, use the ldapsearch command by entering the following:

    # /opt/symas/bin/ldapsearch -x -D "cn=Manager,dc=example,dc=com" \

    -W "cn=tom yan"

Deleting an Entry from the Directory

  1. To delete one or more entries in the directory, run the ldapdelete command as follows:

    # /opt/symas/bin/ldapdelete -x -D "cn=Manager,dc=example,dc=com" \

    -W "uid=tomy,dc=osm,dc=example,dc=com"

  2. To verify the deletion, enter the following command:

    # /opt/symas/bin/ldapsearch -x -D "cn=Manager,dc=example,dc=com" \

    -W "uid=tomy"

Modifying the Relative Distinguished Name for an Entry in the Directory

  1. To modify the Relative Distinguished Name (RDN) for an entry, run the ldapmodrdn command as follows:

    # /opt/symas/bin/ldapmodrdn -x -D "cn=Manager,dc=example,dc=com" \

    -W "uid=tomy,dc=osm,dc=example,dc=com" "uid=tomy-modified"

    Figure 5 Modifying an RDN for Entry

    Modifying an RDN for Entry
  2. To verify the modification, use the ldapsearch command by entering the following:

    # /opt/symas/bin/ldapsearch -x -D "cn=Manager,dc=example,dc=com" \

    -W "cn=tom yan"

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.