]> git.pld-linux.org Git - packages/gdm.git/blame - gdm.init
- added systemd bcond (off by default) - when enabled, systemd is used for
[packages/gdm.git] / gdm.init
CommitLineData
81d695a5 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
17upstart_controlled
18
19# Get service config
20if [ -f /etc/sysconfig/gdm ]; then
21 . /etc/sysconfig/gdm
22fi
23
24start() {
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
38stop() {
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
49condrestart() {
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
60RETVAL=0
61# See how we were called.
62case "$1" in
63 start)
64 start
65 ;;
66 stop)
67 stop
68 ;;
69 restart)
70 stop
71 start
72 ;;
73 try-restart)
74 condrestart 0
75 ;;
76 force-reload)
77 condrestart 7
78 ;;
79 status)
80 status gdm gdm-binary
81 RETVAL=$?
82 ;;
83 *)
84 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
85 exit 3
86esac
87
88exit $RETVAL
This page took 0.142014 seconds and 4 git commands to generate.