Xserver revision 1097
0N/A# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A# Permission is hereby granted, free of charge, to any person obtaining a 0N/A# copy of this software and associated documentation files (the "Software"), 0N/A# to deal in the Software without restriction, including without limitation 0N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 0N/A# and/or sell copies of the Software, and to permit persons to whom the 0N/A# Software is furnished to do so, subject to the following conditions: 0N/A# The above copyright notice and this permission notice (including the next 0N/A# paragraph) shall be included in all copies or substantial portions of the 0N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1472N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1472N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1472N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 0N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 0N/A# DEALINGS IN THE SOFTWARE. 0N/AUSAGE=
"Usage: $0 [-c <class>] :<display> [<X server arguments>]" 0N/A print -u2 "${progname}: $*" 0N/A# Users must not modify this script to change them - change via SMF properties 0N/Aif (( $# > 1 )) ;
then 0N/A # Strip leading ":" from $1 to get display number 0N/Aif [[
"${REMOTE}" ==
"true" ]] ;
then 0N/A# 1) name of SMF property to find in one of the service instances 0N/A# 2) name of variable to store the value of the property in, if found 0N/A# Also sets variable with name of $2_INSTANCE to the service instance the 0N/A# property was found in, for use in later messages. 0N/A # Make ${propval} be a reference to the variable named as the second arg # The "" instance is to get the properties from the base service without if svcprop -q -p $1 "${propinst}" ; then if [[ "${propval}" == "\"\"" ]] ; then # Canonicalize path, so that we don't break people who specified path # via the /usr/X -> openwin or X11 link # Automatically select replacements for removed X servers # Make sure ${XSERVER} is a known X server binary if [[
"${DEFDEPTH}" !=
"" ]] ;
then # Should not happen, but just in case if [[
"${TCP_LISTEN}" ==
"" ]] ;
then if [[
"${REMOTE}" ==
"true" ]] ;
then if [[
"${TCP_LISTEN}" ==
"false" ]] ;
then if [[
("${CONSOLE}" == "true") &&
("${DISPLAY}" == "0") ]] ;
then # Currently only Xorg accepts a command line flag for choosing config files. # If other X servers add such flags in the future, they should be added here. # Only filenames without directory paths are allowed (similar to when a # non-root user runs Xorg -config) to avoid security issues. if [[ ! -z
"${CONFIG_FILE}" ]] ;
then */*)
fatal_error "Illegal value for config_file property" ;;
ALLARGS=
"${DEPTHARG} ${LISTENARG} ${SERVERARGS} ${CONSOLE} ${CONFIGARG} $*"