]>
Commit | Line | Data |
---|---|---|
708ea193 | 1 | #!/bin/sh |
2 | # | |
3 | # gdm: Starts the Gnome Display Manager | |
4 | # | |
2c37b1f4 | 5 | # Version: @(#) /etc/rc.d/init.d/gdm 0.1 |
708ea193 | 6 | # |
c40589db | 7 | # chkconfig: 5 95 05 |
3f1ed04c | 8 | # description: Starts and stops the Gnome Display Manager at startup and \ |
708ea193 | 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 | ||
e6e34130 ER |
17 | upstart_controlled |
18 | ||
708ea193 | 19 | # Get service config |
f7def4df | 20 | if [ -f /etc/sysconfig/gdm ]; then |
2c37b1f4 | 21 | . /etc/sysconfig/gdm |
708ea193 | 22 | fi |
23 | ||
b7570982 ER |
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 | ||
4a7750aa | 60 | RETVAL=0 |
708ea193 | 61 | # See how we were called. |
62 | case "$1" in | |
63 | start) | |
b7570982 | 64 | start |
708ea193 | 65 | ;; |
66 | stop) | |
b7570982 ER |
67 | stop |
68 | ;; | |
69 | restart) | |
70 | stop | |
71 | start | |
72 | ;; | |
73 | try-restart) | |
74 | condrestart 0 | |
75 | ;; | |
76 | force-reload) | |
77 | condrestart 7 | |
708ea193 | 78 | ;; |
79 | status) | |
05e2df46 | 80 | status gdm gdm-binary |
b7570982 | 81 | RETVAL=$? |
708ea193 | 82 | ;; |
83 | *) | |
b7570982 | 84 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" |
4a7750aa | 85 | exit 3 |
708ea193 | 86 | esac |
87 | ||
eb18af7f | 88 | exit $RETVAL |