]> git.pld-linux.org Git - packages/gdm.git/blob - gdm.init
- more verbose files
[packages/gdm.git] / gdm.init
1 #!/bin/sh
2 #
3 # gdm:          Starts the Gnome Display Manager
4 #
5 # Version:      @(#) /etc/rc.d/init.d/gdm 0.1
6 #
7 # chkconfig:    5 95 05
8 # description:  Starts and stops the Gnome Display Manager at startup and \
9 #               shutdown..
10 #
11 # config:       /etc/X11/gdm/gdm-config
12 # probe:        true
13 # hide:         true
14
15 . /etc/rc.d/init.d/functions
16
17 # Get service config
18 if [ -f /etc/sysconfig/gdm ]; then
19         . /etc/sysconfig/gdm
20 fi
21
22 start() {
23         # Check if the service is already running?
24         if [ -f /var/lock/subsys/gdm ]; then
25                 msg_already_running "Gnome Display Manager"
26                 return
27         fi
28
29         msg_starting "Gnome Display Manager"
30         start-stop-daemon --start -b --exec /usr/sbin/gdm
31         ok
32         RETVAL=$?
33         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gdm
34 }
35
36 stop() {
37         if [ ! -f /var/lock/subsys/gdm ]; then
38                 msg_not_running "Gnome Display Manager"
39                 return
40         fi
41
42         msg_stopping "Gnome Display Manager"
43         killproc gdm
44         rm -f /var/lock/subsys/gdm
45 }
46
47 condrestart() {
48         if [ ! -f /var/lock/subsys/gdm ]; then
49                 msg_not_running "Gnome Display Manager"
50                 RETVAL=$1
51                 return
52         fi
53
54         stop
55         start
56 }
57
58 RETVAL=0
59 # See how we were called.
60 case "$1" in
61   start)
62         start
63         ;;
64   stop)
65         stop
66         ;;
67   restart)
68         stop
69         start
70         ;;
71   try-restart)
72         condrestart 0
73         ;;
74   force-reload)
75         condrestart 7
76         ;;
77   status)
78         status gdm gdm-binary
79         RETVAL=$?
80         ;;
81   *)
82         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
83         exit 3
84 esac
85
86 exit $RETVAL
This page took 0.370692 seconds and 3 git commands to generate.