The create-rc-script command generates a shell script to start, stop, and restart the directory server.
create-rc-script [options]
The create-rc-script command can be used to generate a shell script to start, stop, and restart the directory server. You can update the resulting script to suit the needs of your directory service. This command is available for UNIX or Linux systems only.
Note - On Solaris 10 systems, the functionality provided by RC scripts has been replaced by the Service Management Facility (SMF).
create-rc-script uses OPENDS_JAVA_* variables, not JAVA_* variables.
For more information, see Sun OpenDS Standard Edition System Requirements in Sun OpenDS Standard Edition 2.2 Installation Guide.
The create-rc-script command accepts an option in either its short form (for example, -f filename) or its long form equivalent (for example, --outputFile filename).
Specify the path to the output file.
Specify the path to the Java installation that should be used to run the server.
Specify the set of arguments that should be passed to the JVM when running the server.
Specify the name of the user account under which the server should run. The user account must have the appropriate permissions to run the script.
Display the version information for the directory server.
Display command-line usage information for the create-rc-script command.
The following examples show how to use the create-rc-script command. You can use the command on any UNIX, or Linux system that has at least the Java SE 5 (at least Sun version 1.5.0_08, preferably the latest version of Java SE 6) runtime environment installed on its target system.
For more information, see Sun OpenDS Standard Edition System Requirements in Sun OpenDS Standard Edition 2.2 Installation Guide.
The following command generates the script to start, stop, and restart the directory server. It creates the file called myscript, specified by the -f option:
$ create-rc-script -f myscript
The following command uses the newly created script (see previous example) to start the directory server.
$ myscript start
The following command uses the newly created script (see first example) to stop the directory server.
$ myscript stop
The following command uses the newly created script (see first example) to restart the directory server.
$ myscript restart
The following command uses the -u (--userName), -j (--javaHome) and -J (--javaArgs) options.
$ create-rc-script -f myscript -u sysAdmin -j /usr/java -J "-Xms128m -Xmx128m"
The create-rc-script command from the example above generates the following code:
# /bin/sh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # You can obtain a copy of the license at # https://OpenDS.dev.java.net/OpenDS.LICENSE. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at # trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, # add the following below this CDDL HEADER, with the fields enclosed # by brackets "[]" replaced with your own identifying information: # Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # Set the path to the OpenDS instance to manage INSTANCE_ROOT="/usr/local/opends/standalone/ds-server-1" export INSTANCE_ROOT # Specify the path to the Java installation to use OPENDS_JAVA_HOME="/usr/java" export OPENDS_JAVA_HOME # Specify arguments that should be provided to the JVM JAVA_ARGS="-Xms128m -Xmx128m" export JAVA_ARGS # Determine what action should be performed on the server case "${1}" in start) /bin/su sysAdmin "${INSTANCE_ROOT}/bin/start-ds" --quiet exit ${?} ;; stop) /bin/su sysAdmin "${INSTANCE_ROOT}/bin/stop-ds" --quiet exit ${?} ;; restart) /bin/su sysAdmin "${INSTANCE_ROOT}/bin/stop-ds" --restart --quiet exit ${?} ;; *) echo "Usage: $0 { start | stop | restart }" exit 1 ;; esac
An exit code of 0 indicates success. A non-zero exit code indicates that an error occurred.
The create-rc-script command is located at this path:
UNIX and Linux: install-dir/bin/create-rc-script