]>
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 | ||
17 | # Get service config | |
f7def4df | 18 | if [ -f /etc/sysconfig/gdm ]; then |
2c37b1f4 | 19 | . /etc/sysconfig/gdm |
708ea193 | 20 | fi |
21 | ||
b7570982 ER |
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 | ||
4a7750aa | 58 | RETVAL=0 |
708ea193 | 59 | # See how we were called. |
60 | case "$1" in | |
61 | start) | |
b7570982 | 62 | start |
708ea193 | 63 | ;; |
64 | stop) | |
b7570982 ER |
65 | stop |
66 | ;; | |
67 | restart) | |
68 | stop | |
69 | start | |
70 | ;; | |
71 | try-restart) | |
72 | condrestart 0 | |
73 | ;; | |
74 | force-reload) | |
75 | condrestart 7 | |
708ea193 | 76 | ;; |
77 | status) | |
05e2df46 | 78 | status gdm gdm-binary |
b7570982 | 79 | RETVAL=$? |
708ea193 | 80 | ;; |
81 | *) | |
b7570982 | 82 | msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" |
4a7750aa | 83 | exit 3 |
708ea193 | 84 | esac |
85 | ||
eb18af7f | 86 | exit $RETVAL |