#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.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 usr/src/OPENSOLARIS.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
#
#
#
#if startup options contain multiple arguments separated by a blank,
#then they should be specified as below
#
PROPVAL=""
if [ $? -eq 0 ] ; then
if [ "${PROPVAL}" = "\"\"" ] ; then
PROPVAL=""
fi
return
fi
return
}
# Check whether alternate config file was specified using option -f.
# If it's the case, Apache will search in the same directory for
# availability of environment file.
eval "set -- $1"
while [ $# -gt 0 ]; do
esac
shift
done
}
if [ "x${APACHE_VERSION}" != "x" ]; then
echo "Apache version is ${APACHE_VERSION}"
fi
if [ "${PROPVAL}" != "" ] ; then
echo startupoptions set
STARTUP_OPTIONS="${PROPVAL} -k"
envvars_path_update "${PROPVAL}"
fi
if [ "${PROPVAL}x" == "workerx" ] || [ "${PROPVAL}x" == "preforkx" ] ; then
HTTPD="${HTTPD} -D ${PROPVAL}"
fi
case "$1" in
cmd="start"
;;
cmd="graceful"
;;
stop)
cmd="stop"
;;
*)
echo "Usage: $0 {start|stop|refresh}"
exit $SMF_EXIT_ERR_CONFIG
;;
esac
HTTPD="${HTTPD}" APACHE_USER_ENVVARS="${APACHE_USER_ENVVARS}" ${APACHE_BIN}/apachectl ${STARTUP_OPTIONS} ${cmd} 2>&1
if [ $? -ne 0 ]; then
echo "Server failed to start. Check the error log (defaults to ${APACHE_VAR_ROOT}/logs/error_log) for more information, if any."
exit $SMF_EXIT_ERR_FATAL
fi
exit $SMF_EXIT_OK