]>
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 | ||
4a7750aa | 24 | RETVAL=0 |
708ea193 | 25 | # See how we were called. |
26 | case "$1" in | |
27 | start) | |
28 | # Check if the service is already running? | |
29 | if [ ! -f /var/lock/subsys/gdm ]; then | |
30 | msg_starting "Gnome Display Manager" | |
f2a1103b | 31 | start-stop-daemon --start -b --exec /usr/sbin/gdm |
7acef57c | 32 | ok |
eb18af7f | 33 | RETVAL=$? |
554969be | 34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gdm |
708ea193 | 35 | else |
2c37b1f4 | 36 | msg_already_running "Gnome Display Manager" |
708ea193 | 37 | fi |
38 | ;; | |
39 | stop) | |
eb18af7f | 40 | if [ -f /var/lock/subsys/gdm ]; then |
41 | msg_stopping "Gnome Display Manager" | |
42 | killproc gdm | |
43 | rm -f /var/lock/subsys/gdm | |
44 | else | |
2c37b1f4 | 45 | msg_not_running "Gnome Display Manager" |
eb18af7f | 46 | fi |
708ea193 | 47 | ;; |
48 | status) | |
05e2df46 | 49 | status gdm gdm-binary |
4a7750aa | 50 | exit $? |
708ea193 | 51 | ;; |
4a7750aa | 52 | restart|force-reload) |
708ea193 | 53 | $0 stop |
54 | $0 start | |
4a7750aa | 55 | exit $? |
708ea193 | 56 | ;; |
57 | *) | |
4a7750aa | 58 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
59 | exit 3 | |
708ea193 | 60 | esac |
61 | ||
eb18af7f | 62 | exit $RETVAL |