Magellan Linux

Contents of /trunk/magellan-initscripts/etc/rc.d/init.d/xdm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Mon Dec 13 22:52:07 2004 UTC (19 years, 4 months ago) by niro
File size: 1742 byte(s)
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

1 #!/bin/bash
2
3 #%rlevels: 5:s 0:k 1:k 2:k 3:k 4:k 6:k
4 #%start: 95
5 #%stop: 05
6
7 #deps
8 #%needs:
9 #%before:
10 #%after:
11
12 source /etc/sysconfig/rc
13 source $rc_functions
14 source /etc/rc.config
15 source /etc/profile
16
17 if [ -z ${GLOGIN} ]
18 then
19 echo "You have to declare \"GLOGIN\" in /etc/rc.conf !"
20 exit 1
21 fi
22
23 get_login() {
24 case "$GLOGIN" in
25 kdm|KDM)
26 GLOGINCMD="$(which kdm 2> /dev/null)"
27 if [ ! -f "${GLOGINCMD}" ]
28 then
29 echo "Failure: KDE Login Manager not found."
30 exit 1
31 fi
32 ;;
33 xdm|XDM)
34 GLOGINCMD="$(which xdm 2> /dev/null)"
35 if [ ! -f "${GLOGINCMD}" ]
36 then
37 echo "Failure: XDM Login Manager not found."
38 exit 1
39 fi
40 ;;
41 *)
42 GLOGINCMD="$(which ${GLOGIN} 2> /dev/null)"
43 if [ ! -f "${GLOGINCMD}" ]
44 then
45 echo "Failure: \"${GLOGIN}\" Login Manager not found."
46 exit 1
47 fi
48 esac
49 }
50
51 case "$1" in
52 start)
53 get_login
54 echo -e ${COLOREDSTAR}"Starting ${GLOGIN} ..."
55 /sbin/telinit a
56 evaluate_retval
57
58 update_svcstatus $1
59 splash svc_started "$(basename $0)" 0
60 ;;
61 stop)
62 get_login
63 if [ -n "$(ps -A|grep $(basename ${GLOGINCMD}))" ]
64 then
65 echo -e ${COLOREDSTAR}"Stopping ${GLOGIN} ..."
66 #killproc ${GLOGINCMD}
67
68 CUR_VT=$(fgconsole)
69 start-stop-daemon --stop --quiet --exe ${GLOGINCMD}
70 evaluate_retval
71 chvt ${CUR_VT}
72 fi
73 update_svcstatus $1
74 splash svc_started "$(basename $0)" 0
75 ;;
76
77 restart)
78 $0 stop
79 sleep 1
80 $0 start
81 ;;
82 status)
83 get_login
84 statusproc ${GLOGINCMD}
85 ;;
86 *)
87 echo "Usage: $0 {start|stop|restart|status}"
88 exit 1
89 ;;
90 esac

Properties

Name Value
svn:executable *