Xserver revision 970
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Permission is hereby granted, free of charge, to any person obtaining a
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# copy of this software and associated documentation files (the "Software"),
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# to deal in the Software without restriction, including without limitation
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# the rights to use, copy, modify, merge, publish, distribute, sublicense,
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# and/or sell copies of the Software, and to permit persons to whom the
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Software is furnished to do so, subject to the following conditions:
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# The above copyright notice and this permission notice (including the next
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# paragraph) shall be included in all copies or substantial portions of the
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# DEALINGS IN THE SOFTWARE.
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilsonUSAGE="Usage: $0 [-c <class>] :<display> [<X server arguments>]"
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Default values
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Users must not modify this script to change them - change via SMF properties
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilsonwhile getopts :c: opt; do
8d7126a8f999e88851c7dd851a17c27cb6d2ec3fneil_a_wilson # Strip leading ":" from $1 to get display number
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# 1) name of SMF property to find in one of the service instances
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# 2) name of variable to store the value of the property in, if found
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# Also sets variable with name of $2_INSTANCE to the service instance the
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson# property was found in, for use in later messages.
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson # Make ${propval} be a reference to the variable named as the second arg
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson # The "" instance is to get the properties from the base service without
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson for instance in ":display${DISPLAY}" ${CLASSES} "" ; do
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson propinst="svc:/application/x11/x11-server${instance}"
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilsonif [[ -f ${XSERVER} ]] ; then
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson # Canonicalize path, so that we don't break people who specified path
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson # via the /usr/X -> openwin or X11 link
ff7911bf4b588374a79cb2e4b03c4283b9a10376neil_a_wilson # Automatically select replacements for removed X servers