]>
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 | |
bfa83b88 | 8 | # description: Starts and stops the X Display Manager at startup and \ |
9 | # shutdown. can run one of several display managers; gdm, kdm, \ | |
5e2a6703 | 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 |
a64df606 | 19 | if [ -f /etc/sysconfig/xdm ]; then |
4f40a6c7 | 20 | . /etc/sysconfig/xdm |
bb6a1b62 | 21 | fi |
22 | ||
fca14980 | 23 | RETVAL=0 |
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 |
fca14980 | 31 | RETVAL=$? |
32 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xdm | |
4f40a6c7 | 33 | else |
34 | msg_already_running "X Display Manager" | |
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 | |
4f40a6c7 | 41 | rm -f /var/lock/subsys/xdm |
42 | else | |
43 | msg_not_running "X Display Manager" | |
4f40a6c7 | 44 | fi |
5e2a6703 | 45 | ;; |
46 | status) | |
47 | status xdm | |
fca14980 | 48 | exit $? |
5e2a6703 | 49 | ;; |
fca14980 | 50 | restart|force-reload) |
5e2a6703 | 51 | $0 stop |
52 | $0 start | |
4f40a6c7 | 53 | exit $? |
54 | ;; | |
5e2a6703 | 55 | *) |
fca14980 | 56 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
57 | exit 3 | |
5e2a6703 | 58 | esac |
59 | ||
4f40a6c7 | 60 | exit $RETVAL |