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