]>
Commit | Line | Data |
---|---|---|
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 | RETVAL=0 | |
24 | # See how we were called. | |
25 | case "$1" in | |
26 | start) | |
27 | # Check if the service is already running? | |
28 | if [ ! -f /var/lock/subsys/xdm ]; then | |
29 | msg_starting "X Display Manager" | |
30 | daemon /usr/X11R6/bin/xdm | |
31 | RETVAL=$? | |
32 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xdm | |
33 | else | |
34 | msg_already_running "X Display Manager" | |
35 | fi | |
36 | ;; | |
37 | stop) | |
38 | if [ -f /var/lock/subsys/xdm ]; then | |
39 | msg_stopping "X Display Manager" | |
40 | killproc xdm | |
41 | rm -f /var/lock/subsys/xdm | |
42 | else | |
43 | msg_not_running "X Display Manager" | |
44 | fi | |
45 | ;; | |
46 | status) | |
47 | status xdm | |
48 | exit $? | |
49 | ;; | |
50 | restart|force-reload) | |
51 | $0 stop | |
52 | $0 start | |
53 | exit $? | |
54 | ;; | |
55 | *) | |
56 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
57 | exit 3 | |
58 | esac | |
59 | ||
60 | exit $RETVAL |