Magellan Linux

Contents of /branches/init-0_3_3-r1/magellan-initscripts/etc/rc.d/init.d/xdm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations) (download)
Tue Dec 14 01:17:23 2004 UTC (19 years, 4 months ago) by (unknown author)
File size: 1513 byte(s)
This commit was manufactured by cvs2svn to create branch
'init-0_3_3-r1'.
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
67 CUR_VT=$(fgconsole)
68 start-stop-daemon --stop --quiet --exe ${GLOGINCMD}
69 evaluate_retval
70 chvt ${CUR_VT}
71 fi
72 update_svcstatus $1
73 splash svc_started "$(basename $0)" 0
74 ;;
75
76 restart)
77 $0 stop
78 sleep 1
79 $0 start
80 ;;
81 status)
82 get_login
83 statusproc ${GLOGINCMD}
84 ;;
85 *)
86 echo "Usage: $0 {start|stop|restart|status}"
87 exit 1
88 ;;
89 esac

Properties

Name Value
svn:executable *