summaryrefslogtreecommitdiff
blob: 7b6227a2c1e1b2077e18234682e3c7f073777851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/sbin/runscript
# Based upon a script Copyright (c) 1996-99 SuSE GmbH Nuernberg, Germany.  All rights reserved.
# Not sure how much of the SuSE original is left.

# Start X Font Server before X
depend() {
	use xfs
}

. /etc/profile.env
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$ROOTPATH

case "`echo $DISPLAYMANAGER | awk '{ print toupper($1) }'`" in
	KDM|KDE|KDE2|KDE3)	 
		EXE=`which kdm`   
		;;
	GDM|GNOME) 
		EXE=/usr/bin/gdm
		;;
	*)	
		EXE=/usr/X11R6/bin/xdm
		;;
esac

test ! -x "$EXE" && EXE=/usr/X11R6/bin/xdm

SERVICE=${EXE##*/}
PID="/var/run/xdm.pid"

start() {
	ebegin "Starting ${SERVICE}"
	start-stop-daemon --start --quiet --exe $EXE 1>&2
	if [ -n "$?" ] ; then
		# After a crash or a kill signal we may have
		# a wrong ownership of /dev/console
		chown root:tty /dev/console /dev/tty0
		chmod 622 /dev/console /dev/tty0
	else
		eend $? "Error starting ${SERVICE}."
	fi
}

stop() {
	ebegin "Stopping ${SERVICE}"
	killall X
	start-stop-daemon --stop --quiet --exe $EXE 1>&2
	eend $? "Error stopping ${SERVICE}."
}