svc-pkg-depot revision 1518
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Load SMF constants and functions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteif [[ -z "$SMF_FMRI" ]]; then
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "this script can only be invoked by smf(5)"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Handles depot startup
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # boolean_props are properties which are communicated to the depot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # via a flag being present or absent on the command line.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # short_option_props are properties which are communicated to the depot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # via a single character flag which takes an argument.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte short_option_props="inst_root port threads socket_timeout"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # short_option_props are properties which are communicated to the depot
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # via a long option flag which takes an argument.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long_option_props="cfg_file content_root debug log_access log_errors \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte proxy_base sort_file_max_size ssl_cert_file ssl_dialog ssl_key_file \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte writable_root"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte set -A long_option_cmd_line "cfg-file" "content-root" "debug" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "log-access" "log-errors" "proxy-base" "sort-file-max-size" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "ssl-cert-file" "ssl-dialog" "ssl-key-file" "writable-root"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # retrieve the pkg_root property. If the variable is left empty
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # pkg_root is /
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "service property pkg/pkg_root not defined for" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # make sure pkg_root ends with a /
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # adjust the PYTHONPATH to point to the current environment
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte PYTHONPATH=${pkg_root}usr/lib/python2.4/vendor-packages/:$PYTHONPATH
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # Go through each property in boolean_props and, if its value is set
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # to true in SMF, add the appropriate command line flag to the string.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte echo "service property pkg/$b not defined for" \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # If the property is set to true, add the flag.
"service: $SMF_FMRI"
exit $SMF_EXIT_ERR_CONFIG
"service: $SMF_FMRI"
exit $SMF_EXIT_ERR_CONFIG
echo "option_ops: [$option_ops]"
# Build the command to start pkg.depotd with the specified options.
echo $cmd
exec $cmd
echo "service property stop/timeout_seconds not defined" \
"for service: $SMF_FMRI"
exit $SMF_EXIT_ERR_CONFIG
ret=$?
exit $SMF_EXIT_ERR_FATAL
exit $SMF_EXIT_ERR_CONFIG
exit $SMF_EXIT_OK