IBM Support

auto-starting instances on RHEL 5

Troubleshooting


Problem

Example scripts using chkconfig functionality on RHEL 5 to auto-start multiple instances

Resolving The Problem

Here's an example of a script that will auto-start IBM Directory Server instances in Redhat. This script can be used to create multiple scripts in the case there are multiple IDS instances (available in IDS 6.0 and later).

The script:

#!/bin/bash
#
# chkconfig: 2345 99 99
# description: LDAP instance service
#
# source function library
. /etc/rc.d/init.d/functions


start()
{
/opt/ibm/ldap/V6.0/sbin/ibmslapd -I ldap > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}

stop()
{
/opt/ibm/ldap/V6.0/sbin/ibmslapd -I ldap -k > /dev/null 2>&1
RETVAL=$?
return $RETVAL
}

case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop}"
RETVAL=1
;;
esac

This script needs to be changed to match the user's environment:

1) The name of the instance needs to be changed in the start() and stop() functions to match the instance in the user's environment.

2) The 'chkconfig' line might need to be changed to change the run-levels at which IDS starts. See your Redhat docs to learn in more detail how chkconfig works.

After this script is altered to match the user's environment, the script should be copied to /etc/init.d. It can be called anything, although for the sake of clarity, it might make sense to call it 'ibmslapd_<instance>'. Also, this script needs to be made executable.

Next, run the following command to have the script add chkconfig support:

chkconfig ibmslapd_ldap --add

Then, run the following command to have the links to the /etc/rc.d run-level directories setup automatically (these links are responsible for actually auto-starting the instance when the server is booted up):

chkconfig ibmslapd_ldap on

This will enable auto-starting the ibmslapd instance in run-levels 2, 3, 4 and 5, per the chkconfig line in the comments section of the script.

Creating the script in this way allows for more convenient management of the services; starting and stopping the service is as simple as:

service ibmslapd_ldap start
service ibmslapd_ldap stop

NOTE: RHEL 6.x no longer supports the old SystemV init startup system and now uses the 'upstart' init system. See this technote for information for starting the ITDS daemons from upstart. In my testing, the method above seems to work as well on RHEL 6.x as it did in older versions.

[{"Product":{"code":"SSVJJU","label":"IBM Security Directory Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF016","label":"Linux"}],"Version":"6.0;6.1;6.2;6.3;6.3.1;6.4","Edition":"","Line of Business":{"code":"LOB24","label":"Security Software"}}]

Document Information

Modified date:
16 June 2018

UID

swg21244305