x11-server revision 970
385N/A#!/bin/ksh
385N/A#
385N/A# Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
385N/A#
385N/A# Permission is hereby granted, free of charge, to any person obtaining a
385N/A# copy of this software and associated documentation files (the "Software"),
385N/A# to deal in the Software without restriction, including without limitation
385N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
385N/A# and/or sell copies of the Software, and to permit persons to whom the
385N/A# Software is furnished to do so, subject to the following conditions:
385N/A#
385N/A# The above copyright notice and this permission notice (including the next
385N/A# paragraph) shall be included in all copies or substantial portions of the
385N/A# Software.
385N/A#
385N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
385N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
385N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
407N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
385N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
385N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
385N/A# DEALINGS IN THE SOFTWARE.
385N/A#
385N/A
385N/AUSAGE="Usage: $0 [-d <display>] [-c <class>] <method> [-- <X server arguments>]"
385N/A
385N/APATH=/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/X11/bin
385N/A
385N/A#########
385N/A#
385N/A# Default values
385N/A#
385N/A# Users must not modify this script to change them - change via SMF properties
385N/A#
385N/A
385N/ADISPLAY="0"
385N/ACLASSES=""
385N/A
385N/Awhile getopts c:d: opt; do
385N/A case $opt in
385N/A c) if [ "$OPTARG" != "default" ] ; then
385N/A CLASSES="$CLASSES -c $OPTARG"
385N/A fi ;;
385N/A d) DISPLAY="$OPTARG";;
385N/A ?) echo $USAGE ; exit 2;;
385N/A esac
385N/Adone
456N/A
385N/Ashift `expr $OPTIND - 1`
385N/A
385N/AMETHOD=$1
385N/Aif [ $# -lt 1 ] ; then
385N/A echo $USAGE
385N/A exit 2
385N/Afi
385N/Ashift
385N/A
385N/Acase $METHOD in
385N/A start)
385N/A # Continue with rest of script
385N/A ;;
385N/A *)
434N/A echo "Invalid method $METHOD"
385N/A exit 2
385N/A ;;
385N/Aesac
385N/A
385N/Aif [ "$1" = "--" ] ; then
385N/A shift
385N/Aelse
385N/A if [ "$1" != "" ] ; then
385N/A echo $USAGE
385N/A exit 2
385N/A fi
385N/Afi
385N/A
385N/A# If the X server is started with SIGUSR1 set to ignore, then it
385N/A# sends SIGUSR1 to its parent process when it is ready to run
385N/AXserver_ready() {
385N/A exit 0
385N/A}
385N/A
385N/Atrap Xserver_ready USR1
385N/A(trap '' USR1 ; exec /usr/bin/Xserver $CLASSES :$DISPLAY $* &)
385N/A
385N/A