svc-pkg-mdns revision 1902
3N/A# The contents of this file are subject to the terms of the 3N/A# Common Development and Distribution License (the "License"). 3N/A# You may not use this file except in compliance with the License. 3N/A# See the License for the specific language governing permissions 3N/A# and limitations under the License. 3N/A# When distributing Covered Code, include this CDDL HEADER in each 3N/A# If applicable, add the following below this CDDL HEADER, with the 3N/A# fields enclosed by brackets "[]" replaced with your own identifying 3N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3N/A# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. 3N/A# Load SMF constants and functions 59N/A echo "this script can only be invoked by smf(5)" 175N/A # Handles mDNS depot startup 30N/A # short_option_props are properties which are communicated to the depot 30N/A # via a single character flag which takes an argument. 30N/A # retrieve the pkg_root property. If the variable is left empty 933N/A # make sure pkg_root ends with a / 3N/A # adjust the PYTHONPATH to point to the current environment 1698N/A # we need to make sure to adjust the PYTHONPATH accordingly 1698N/A # to a Python 2.4 or 2.6 environment 526N/A # Go through each property in short_option_props and, if its value is 526N/A # set to something other than "", add the appropriate command line 526N/A # flag and argument to the string. 2639N/A echo "service property pkg/$o not defined for" \
3N/A # If the SMF property is set to something other than 'none', add 1698N/A # the flag and its argument to the command. 526N/A # Go through each property in long_option_props and, if its value is 146N/A # set to something other than "", add the appropriate command line 146N/A # flag and argument to the string. 3N/A echo "service property pkg/$o not defined for" \
30N/A # In order to run in mdns mode, we need to append the --llmirror 416N/A # flag to the list of command options. Do that last, here. 30N/A # Echo the command so that the log contains the command used to start 3N/A # Strategy: First, try shutting down depot using polite kill. Use up 3N/A # as much as possible of the allotted timeout period waiting for polite 852N/A # kill to take effect. As time runs out, try a more aggressive kill. 2224N/A # Note that we're working around an oddity in smf_kill_contract: it 852N/A # waits in 5 second chunks and can overshoot the specified timeout 852N/A # by as many as 4 seconds. Example: a specified wait of 6 will result 852N/A # in a wait of 10 seconds in reality. Since we may potentially do a 852N/A # first kill and then a second, we must ensure that at least 8 seconds 852N/A # of slop is left in reserve. To be paranoid, we go for 10. 2224N/A # '2' indicates timeout with non-empty contract. 2224N/A echo "Gentle contract kill timed out after" 2224N/A # Again, despite the specified timeout, this will 2224N/A # take a minimum of 5 seconds to complete. 852N/A # If the timeout is too short, we just try once, politely. 852N/A echo "Usage: $0 { start | stop }"