]>
Commit | Line | Data |
---|---|---|
5e2a6703 | 1 | #!/bin/sh |
2 | # | |
3 | # xdm: Starts the X Display Manager | |
4 | # | |
4f40a6c7 | 5 | # Version: @(#) /etc/rc.d/init.d/xdm 1.3 |
5e2a6703 | 6 | # |
7 | # chkconfig: 5 95 5 | |
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 | ||
bb6a1b62 | 18 | # Get service config |
19 | if [ -f /etc/sysconfig/xdm ] ; then | |
4f40a6c7 | 20 | . /etc/sysconfig/xdm |
bb6a1b62 | 21 | fi |
22 | ||
4f40a6c7 | 23 | |
5e2a6703 | 24 | # See how we were called. |
25 | case "$1" in | |
45c6df21 | 26 | start) |
5e2a6703 | 27 | # Check if the service is already running? |
4f40a6c7 | 28 | if [ ! -f /var/lock/subsys/xdm ]; then |
ce48ad5a | 29 | msg_starting "X Display Manager" |
5e2a6703 | 30 | daemon /usr/X11R6/bin/xdm |
45c6df21 | 31 | touch /var/lock/subsys/xdm |
4f40a6c7 | 32 | else |
33 | msg_already_running "X Display Manager" | |
34 | exit 1 | |
5e2a6703 | 35 | fi |
5e2a6703 | 36 | ;; |
37 | stop) | |
4f40a6c7 | 38 | if [ -f /var/lock/subsys/xdm ]; then |
39 | msg_stopping "X Display Manager" | |
40 | killproc xdm | |
41 | RETVAL=$? | |
42 | rm -f /var/lock/subsys/xdm | |
43 | else | |
44 | msg_not_running "X Display Manager" | |
45 | exit 1 | |
46 | fi | |
5e2a6703 | 47 | ;; |
48 | status) | |
49 | status xdm | |
50 | ;; | |
51 | restart|reload) | |
52 | $0 stop | |
53 | $0 start | |
4f40a6c7 | 54 | exit $? |
55 | ;; | |
56 | force-reload) | |
57 | $0 stop && $0 start | |
58 | exit $? | |
5e2a6703 | 59 | ;; |
60 | *) | |
4f40a6c7 | 61 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
5e2a6703 | 62 | exit 1 |
63 | esac | |
64 | ||
4f40a6c7 | 65 | exit $RETVAL |