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] 3356N/A# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. 661N/A# Load SMF constants and functions 3356N/A echo "this script can only be invoked by smf(7)" 1518N/A # retrieve the pkg_root property. If the variable is left empty 1518N/A # make sure pkg_root ends with a / 2852N/A # if configured readonly & standalone, refresh the depot service, 2852N/A # if is is present, and exit immediately as a transient service. 1518N/A # adjust the PYTHONPATH to point to the current environment 1527N/A # we need to make sure to adjust the PYTHONPATH accordingly 3177N/A # to a Python 2.7 or 3.4 environment 719N/A # If this process has net_privaddr, then we pass it along. 719N/A # If not, we ensure that we don't specify it, since that will 719N/A # cause ppriv to throw an error. 849N/A echo "Dropping net_privaddr privilege." 1976N/A # Build up the privileges available starting with "basic". This 661N/A # Echo the command so that the log contains the command used to start 2852N/A # if configured readonly & standalone, exit immediately as transient 2852N/A # the server in order to apply those changes. 2852N/A echo "depot in use, stop method script complete." 775N/A # as much as possible of the allotted timeout period waiting for polite 775N/A # kill to take effect. As time runs out, try a more aggressive kill. 775N/A # Note that we're working around an oddity in smf_kill_contract: it 775N/A # waits in 5 second chunks and can overshoot the specified timeout 775N/A # by as many as 4 seconds. Example: a specified wait of 6 will result 775N/A # in a wait of 10 seconds in reality. Since we may potentially do a 775N/A # first kill and then a second, we must ensure that at least 8 seconds 775N/A # of slop is left in reserve. To be paranoid, we go for 10. 849N/A # '2' indicates timeout with non-empty contract. 1976N/A echo "Gentle contract kill timed out after" \
849N/A # Again, despite the specified timeout, this will 849N/A # take a minimum of 5 seconds to complete. 849N/A # If the timeout is too short, we just try once, politely. 775N/A echo "Usage: $0 { start | stop }"