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