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