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