svc-pkg-server revision 2852
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# CDDL HEADER START
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# The contents of this file are subject to the terms of the
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# Common Development and Distribution License (the "License").
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# You may not use this file except in compliance with the License.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# or http://www.opensolaris.org/os/licensing.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# See the License for the specific language governing permissions
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# and limitations under the License.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# When distributing Covered Code, include this CDDL HEADER in each
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# If applicable, add the following below this CDDL HEADER, with the
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# fields enclosed by brackets "[]" replaced with your own identifying
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# information: Portions Copyright [yyyy] [name of copyright owner]
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# CDDL HEADER END
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# Copyright (c) 2009, 2013 Oracle and/or its affiliates. All rights reserved.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi# Load SMF constants and functions
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchiif [[ -z "$SMF_FMRI" ]]; then
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi echo "this script can only be invoked by smf(5)"
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # Handles server startup
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # retrieve the pkg_root property. If the variable is left empty
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # pkg_root is /
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi pkg_root=$(svcprop -p pkg/pkg_root $SMF_FMRI)
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi echo "service property pkg/pkg_root not defined for" \
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # make sure pkg_root ends with a /
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # if configured readonly & standalone, refresh the depot service,
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi # if is is present, and exit immediately as a transient service.
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi readonly=$(svcprop -p pkg/readonly $SMF_FMRI)
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi standalone=$(svcprop -p pkg/standalone $SMF_FMRI)
9d26e4fc021e249c93c2861629cc665e4f5bd4d6Robert Mustacchi if [[ "$readonly" == "true" ]] && [[ "$standalone" == "false" ]] && \
"svc:/application/pkg/depot configuration updated."
echo "invalid python version $python_ver found in"
echo "${pkg_root}usr/lib/pkg.depotd"
exit $SMF_EXIT_ERR_FATAL
export PYTHONPATH
# provides some protection even when pkg.depotd runs as root.
A=basic,-file_link_any,-proc_info,-proc_session$privaddr -e"
# Build the command to start pkg.depotd.
# pkg.depotd.
echo $cmd
exec $cmd
# unless we've got a running pkg.depotd process, which happens if the
# there's no existing pkg.depotd - we can exit now.
exit $SMF_EXIT_OK
# Strategy: First, try shutting down pkg.depotd using polite kill. Use up
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