Magellan Linux

Annotation of /tags/init-0_3_3-r4/magellan-initscripts/etc/rc.d/init.d/xdm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 54 - (hide annotations) (download)
Mon Feb 14 22:27:37 2005 UTC (19 years, 3 months ago) by (unknown author)
File size: 1797 byte(s)
This commit was manufactured by cvs2svn to create tag
'init-0_3_3-r4'.
1 niro 2 #!/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 niro 46 XDM_OPT=$1
24    
25 niro 2 get_login() {
26     case "$GLOGIN" in
27     kdm|KDM)
28     GLOGINCMD="$(which kdm 2> /dev/null)"
29     if [ ! -f "${GLOGINCMD}" ]
30     then
31     echo "Failure: KDE Login Manager not found."
32     exit 1
33     fi
34     ;;
35 niro 46 gdm|GDM)
36     if [[ ${XDM_OPT} = stop ]]
37     then
38     GLOGINCMD="$(which gdm-binary 2> /dev/null)"
39     else
40     GLOGINCMD="$(which gdm 2> /dev/null)"
41     fi
42     if [ ! -f "${GLOGINCMD}" ]
43     then
44     echo "Failure: KDE Login Manager not found."
45     exit 1
46     fi
47     ;;
48 niro 2 xdm|XDM)
49     GLOGINCMD="$(which xdm 2> /dev/null)"
50     if [ ! -f "${GLOGINCMD}" ]
51     then
52     echo "Failure: XDM Login Manager not found."
53     exit 1
54     fi
55     ;;
56     *)
57     GLOGINCMD="$(which ${GLOGIN} 2> /dev/null)"
58     if [ ! -f "${GLOGINCMD}" ]
59     then
60     echo "Failure: \"${GLOGIN}\" Login Manager not found."
61     exit 1
62     fi
63     esac
64     }
65    
66 niro 46 case "${XDM_OPT}" in
67 niro 13 start)
68 niro 2 get_login
69 niro 13 echo -e ${COLOREDSTAR}"Starting ${GLOGIN} ..."
70 niro 2 /sbin/telinit a
71     evaluate_retval
72    
73     update_svcstatus $1
74     splash svc_started "$(basename $0)" 0
75     ;;
76 niro 13 stop)
77 niro 2 get_login
78     if [ -n "$(ps -A|grep $(basename ${GLOGINCMD}))" ]
79     then
80 niro 13 echo -e ${COLOREDSTAR}"Stopping ${GLOGIN} ..."
81 niro 2
82     CUR_VT=$(fgconsole)
83     start-stop-daemon --stop --quiet --exe ${GLOGINCMD}
84     evaluate_retval
85     chvt ${CUR_VT}
86     fi
87     update_svcstatus $1
88 niro 46 splash svc_stopped "$(basename $0)" 0
89 niro 2 ;;
90    
91 niro 13 restart)
92     $0 stop
93     sleep 1
94     $0 start
95     ;;
96     status)
97 niro 2 get_login
98 niro 13 statusproc ${GLOGINCMD}
99     ;;
100     *)
101     echo "Usage: $0 {start|stop|restart|status}"
102     exit 1
103     ;;
104 niro 2 esac

Properties

Name Value
svn:executable *