178N/A# $Id: start-ds 560 2013-05-22 07:36:34Z elkner $ 178N/A# The contents of this file are subject to the terms of the 178N/A# Common Development and Distribution License, Version 1.0 only 178N/A# (the "License"). You may not use this file except in compliance 178N/A# You can obtain a copy of the license at 178N/A# See the License for the specific language governing permissions 178N/A# and limitations under the License. 178N/A# When distributing Covered Code, include this CDDL HEADER in each 178N/A# file and include the License file at 178N/A# add the following below this CDDL HEADER, with the fields enclosed 1400N/A# by brackets "[]" replaced with your own identifying information: 178N/A# Portions Copyright [yyyy] [name of copyright owner] 814N/A# Copyright 2006-2009 Sun Microsystems, Inc. 814N/A# Portions Copyright 2011 ForgeRock AS 178N/A# Portions Copyright 2013 Jens Elkner 618N/A# Set environment variables 844N/A# would use -i, but -s is also just version info but is not a common switch 519N/A # remove no detach arg and assume, it is started by SMF 178N/A [[ ${
ARG} ==
'-N' || ${
ARG} ==
'--nodetach' ]] &&
continue 1400N/A # issue a warning, if the service is running and one tries to start it 1400N/A # manually as well - let the app do the rest 1400N/A print -
u2 "WARNING: The service '${SMF_FMRI}' is not disabled!" 178N/A# Specify the locations of important files that may be used when the server 178N/A# We do not check for startability, since for non-Windows it just returns 178N/A# based on the passed arguments: 181N/A# 99 => 'start as detached' 178N/A# 100 => 'start as non-detached' 1400N/A# 103 => 'start as detached quiet' 1400N/A# 104 => 'start as non-detached quiet' 1400N/A# what we already know by parsing the args above. If an arg or instance problem 1400N/A# exists, exit 999 from checkEnv or checkInstance would prevent getting here. 178N/A# So doing a --checkStartability would not by us anything ... 178N/A print $! >
"${PID_FILE}" 178N/A # 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