]> git.pld-linux.org Git - packages/X11.git/blame - xdm.init
- cleanup
[packages/X11.git] / xdm.init
CommitLineData
24c0d079 1#!/bin/sh
2#
3# xdm: Starts the X Display Manager
4#
a904603f 5# Version: @(#) /etc/rc.d/init.d/xdm 1.3
24c0d079 6#
049c32e3 7# chkconfig: 5 95 05
3c3b42f9 8# description: Starts and stops the X Display Manager at startup and \
9# shutdown. can run one of several display managers; gdm, kdm, \
24c0d079 10# or xdm, in that order of preferential treatment.
11#
12# config: /etc/X11/xdm/xdm-config
13# probe: true
14# hide: true
15
16. /etc/rc.d/init.d/functions
17
c129eaaa 18# Get service config
dcef0811 19if [ -f /etc/sysconfig/xdm ]; then
a904603f 20 . /etc/sysconfig/xdm
c129eaaa 21fi
22
1c8d3e4a 23start() {
a904603f 24 if [ ! -f /var/lock/subsys/xdm ]; then
f0cd1d9d 25 msg_starting "X Display Manager"
d2ccf300 26 daemon xdm
7533d254 27 RETVAL=$?
28 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xdm
a904603f 29 else
30 msg_already_running "X Display Manager"
24c0d079 31 fi
1c8d3e4a
JB
32}
33
34stop() {
a904603f 35 if [ -f /var/lock/subsys/xdm ]; then
36 msg_stopping "X Display Manager"
37 killproc xdm
a904603f 38 rm -f /var/lock/subsys/xdm
39 else
40 msg_not_running "X Display Manager"
a904603f 41 fi
1c8d3e4a
JB
42}
43
44condrestart() {
45 if [ -f /var/lock/subsys/xdm ]; then
46 stop
47 start
48 else
49 msg_not_running xdm
50 RETVAL=$1
51 fi
52}
53
54RETVAL=0
55# See how we were called.
56case "$1" in
57 start)
58 start
59 ;;
60 stop)
61 stop
62 ;;
63 restart)
64 stop
65 start
66 ;;
67 try-restart)
68 condrestart 0
69 ;;
70 force-reload)
71 condrestart 7
24c0d079 72 ;;
73 status)
74 status xdm
7533d254 75 exit $?
24c0d079 76 ;;
24c0d079 77 *)
1c8d3e4a 78 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
7533d254 79 exit 3
24c0d079 80esac
81
a904603f 82exit $RETVAL
This page took 0.108561 seconds and 4 git commands to generate.