]> git.pld-linux.org Git - packages/gdm.git/blame_incremental - gdm.init
drop all Upstart hacks
[packages/gdm.git] / gdm.init
... / ...
CommitLineData
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# Get service config
18if [ -f /etc/sysconfig/gdm ]; then
19 . /etc/sysconfig/gdm
20fi
21
22start() {
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
36stop() {
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
47condrestart() {
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
58RETVAL=0
59# See how we were called.
60case "$1" in
61 start)
62 start
63 ;;
64 stop)
65 stop
66 ;;
67 restart)
68 stop
69 start
70 ;;
71 try-restart)
72 condrestart 0
73 ;;
74 force-reload)
75 condrestart 7
76 ;;
77 status)
78 status gdm gdm-binary
79 RETVAL=$?
80 ;;
81 *)
82 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
83 exit 3
84esac
85
86exit $RETVAL
This page took 0.029617 seconds and 4 git commands to generate.