]> git.pld-linux.org Git - packages/XFree86.git/blob - xdm.init
- 4.8.0 (probably the last XFree86 version ever, for comparison and archival reasons)
[packages/XFree86.git] / xdm.init
1 #!/bin/sh
2 #
3 # xdm:          Starts the X Display Manager
4 #
5 # Version:      @(#) /etc/rc.d/init.d/xdm 1.3
6 #
7 # chkconfig:    5 95 05
8 # description:  Starts and stops the X Display Manager at startup and \
9 #               shutdown. can run one of several display managers; gdm, kdm, \
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
18 # Get service config
19 if [ -f /etc/sysconfig/xdm ]; then
20         . /etc/sysconfig/xdm
21 fi
22
23 start() {
24         if [ ! -f /var/lock/subsys/xdm ]; then
25                 msg_starting "X Display Manager"
26                 daemon xdm
27                 RETVAL=$?
28                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xdm
29         else
30                 msg_already_running "X Display Manager"
31         fi
32 }
33
34 stop() {
35         if [ -f /var/lock/subsys/xdm ]; then
36                 msg_stopping "X Display Manager"
37                 killproc xdm
38                 rm -f /var/lock/subsys/xdm
39         else
40                 msg_not_running "X Display Manager"
41         fi
42 }
43
44 condrestart() {
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
54 RETVAL=0
55 # See how we were called.
56 case "$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
72         ;;
73   status)
74         status xdm
75         exit $?
76         ;;
77   *)
78         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
79         exit 3
80 esac
81
82 exit $RETVAL
This page took 0.083262 seconds and 3 git commands to generate.