]> git.pld-linux.org Git - packages/gdm.git/blob - gdm.init
systemd unit
[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 upstart_controlled
18
19 # Get service config
20 if [ -f /etc/sysconfig/gdm ]; then
21         . /etc/sysconfig/gdm
22 fi
23
24 start() {
25         # Check if the service is already running?
26         if [ -f /var/lock/subsys/gdm ]; then
27                 msg_already_running "Gnome Display Manager"
28                 return
29         fi
30
31         msg_starting "Gnome Display Manager"
32         start-stop-daemon --start -b --exec /usr/sbin/gdm
33         ok
34         RETVAL=$?
35         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gdm
36 }
37
38 stop() {
39         if [ ! -f /var/lock/subsys/gdm ]; then
40                 msg_not_running "Gnome Display Manager"
41                 return
42         fi
43
44         msg_stopping "Gnome Display Manager"
45         killproc gdm
46         rm -f /var/lock/subsys/gdm
47 }
48
49 condrestart() {
50         if [ ! -f /var/lock/subsys/gdm ]; then
51                 msg_not_running "Gnome Display Manager"
52                 RETVAL=$1
53                 return
54         fi
55
56         stop
57         start
58 }
59
60 RETVAL=0
61 # See how we were called.
62 case "$1" in
63   start)
64         start
65         ;;
66   stop)
67         stop
68         ;;
69   restart)
70         stop
71         start
72         ;;
73   try-restart)
74         condrestart 0
75         ;;
76   force-reload)
77         condrestart 7
78         ;;
79   status)
80         status gdm gdm-binary
81         RETVAL=$?
82         ;;
83   *)
84         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
85         exit 3
86 esac
87
88 exit $RETVAL
This page took 0.036155 seconds and 3 git commands to generate.