start-ds revision 6331
390N/A# $Id: start-ds 560 2013-05-22 07:36:34Z elkner $ 390N/A# The contents of this file are subject to the terms of the 390N/A# Common Development and Distribution License, Version 1.0 only 390N/A# (the "License"). You may not use this file except in compliance 390N/A# You can obtain a copy of the license at 390N/A# See the License for the specific language governing permissions 390N/A# and limitations under the License. 390N/A# When distributing Covered Code, include this CDDL HEADER in each 390N/A# file and include the License file at 390N/A# add the following below this CDDL HEADER, with the fields enclosed 390N/A# by brackets "[]" replaced with your own identifying information: 390N/A# Portions Copyright [yyyy] [name of copyright owner] 390N/A# Copyright 2006-2009 Sun Microsystems, Inc. 390N/A# Portions Copyright 2011 ForgeRock AS 390N/A# Portions Copyright 2013 Jens Elkner 390N/A# Set environment variables 390N/A# would use -i, but -s is also just version info but is not a common switch 390N/A # remove no detach arg and assume, it is started by SMF 390N/A [[ ${
ARG} ==
'-N' || ${
ARG} ==
'--nodetach' ]] &&
continue [[ ${
ARG} ==
'-F' || ${
ARG} ==
'--fullVersion' ]] &&
INFO=
1 [[ ${
ARG} ==
'-s' || ${
ARG} ==
'--systemInfo' ]] &&
INFO=
1 # issue a warning, if the service is running and one tries to start it # manually as well - let the app do the rest if (( ! INFO )) && [[
${ uname -s ; } ==
'SunOS' ]];
then if [[ -n ${
STATE} && ${
STATE} !=
'disabled' ]];
then print -
u2 "WARNING: The service '${SMF_FMRI}' is not disabled!" # Specify the locations of important files that may be used when the server # We do not check for startability, since for non-Windows it just returns # based on the passed arguments: # 99 => 'start as detached' # 100 => 'start as non-detached' # 103 => 'start as detached quiet' # 104 => 'start as non-detached quiet' # what we already know by parsing the args above. If an arg or instance problem # exists, exit 999 from checkEnv or checkInstance would prevent getting here. # So doing a --checkStartability would not by us anything ... --
configFile "${CONFIG_FILE}" "${DJARGS[@]}" >
"${LOG_FILE}" 2>&
1 &
# wait until server startup has finished: removes ${STARTING_FILE} when done # 1 => 'internal error', '2' => 'timeout' (( ${RC} != 0 )) &&
exit ${
RC}
# now check, whether the server is still running # 98 => 'already started', otherwise server doesn't run (( $? == 98 )) &&
exit 0 ||
exit 1