#!/bin/sh
#
# Copyright 2008, 2011, Oracle and/or its affiliates. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "@(#)svc-gdm.src 1.1 06/02/06 SMI"
#
# For modifying parameters passed to dtlogin, do not edit
# this script. Instead use svccfg(1m) to modify the SMF
# repository. For example:
#
# # svccfg
# svc:> select application/graphical-login/gdm
# svc:/application/graphical-login/gdm> setprop gdm/args = "--fatal-warnings"
# svc:/application/graphical-login/gdm> exit
. /lib/svc/share/smf_include.sh
case "$1" in
'start')
FMRI=svc:/application/graphical-login/gdm
arg=`eval "echo \`svcprop -p gdm/args $FMRI\`"`
/usr/sbin/gdm $arg &
rc=$?
if [ $rc != 0 ]; then
echo "$0: gdm failed with $rc"
exit $SMF_EXIT_ERR_FATAL
fi
;;
'stop')
PIDFILE=/var/run/gdm.pid
if test '!' -f $PIDFILE ; then
echo "$PIDFILE doesn't exist, perhaps GDM isn't running"
else
# exec the kill to get the correct return code
exec kill -TERM `cat $PIDFILE`
fi
;;
*)
echo "Usage: $0 { start | stop }"
exit $SMF_EXIT_ERR_FATAL
;;
esac
exit $SMF_EXIT_OK