svc-pkg-depot revision 2858
7189N/A# The contents of this file are subject to the terms of the 7189N/A# Common Development and Distribution License (the "License"). 7189N/A# You may not use this file except in compliance with the License. 7189N/A# See the License for the specific language governing permissions 7189N/A# and limitations under the License. 7189N/A# When distributing Covered Code, include this CDDL HEADER in each 7189N/A# If applicable, add the following below this CDDL HEADER, with the 7189N/A# fields enclosed by brackets "[]" replaced with your own identifying 7189N/A# information: Portions Copyright [yyyy] [name of copyright owner] 7189N/A# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 7189N/A# We want to keep the depot service completely separate from 7189N/A# In this method script, we call httpd directly instead, but as a 7189N/A# result, we also need to include the relevant contents of 7189N/A echo "ERROR: SMF property for $2 was empty" 7189N/A# A function to pull in the config properties from the FMRI given 7189N/A# as the first argument. This allows us to make a single call 7189N/A# to svcprop, rather than calling svcprop for each value we 7189N/A sed -e 's#config/#depot_#g' -e 's/$/,/g')" # print a normalized version of a path, needed because # many utilities will not dereference non-existent directories # make sure we leave nothing behind "pkg.depot-config: failed to create Apache config" # if we dropped to maintenance and are in the process of # clearing that state, we may have htcacheclean processes if [ "${depot_cache_max}" != "0" ] ; then # Start a cache cleaning daemon, scanning every 2 weeks, # being intelligent about only running if the cache has # changed, limiting the cache to ${depot_cache_max} # megabytes, being nice about scheduling and removing # empty directories if necessary. # We go to lengths to kill remaining httpd processes: if we kill # zombies, hanging onto the server port, which causes problems # when trying to start a service that is transitioning from # This function should only be called when the service is # transitioning to maintenance: normal Apache shutdown is # Ping the service, ensuring the index gets built if does # Since curl --retry uses an exponential backoff algorithm, this # can result in us waiting 40 seconds, which ought to be long # enough for Apache to come online. (index refreshes are run in # the background on the server after it has returned a response) url="http://${depot_host}:${depot_port}" url="http://\[${depot_host}\]:${depot_port}" the SMF service log or the error log at ${depot_log_dir}/error_log for\ more information, if any." if [
"${depot_allow_refresh}" ==
"true" ] ;
then FAILED_TO_RUN=
"Server failed to %s. Check the SMF service log or the\ error log at ${depot_log_dir}/error_log for more information, if any." # drop privileges now that we've written our configuration # drop privileges now that we've written our configuration echo "Usage: $0 {start|stop|refresh}"