]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - debian/lightdm.upstart
Tidy up LightDMGreeterError documentation - still not sure why it doesn't show in...
[sojka/lightdm.git] / debian / lightdm.upstart
1 # LightDM - light Display Manager
2 #
3 # The display manager service manages the X servers running on the
4 # system, providing login and auto-login services
5 #
6 # based on gdm upstart script
7
8 description     "LightDM Display Manager"
9 author          "Robert Ancell <robert.ancell@canonical.com>"
10
11 start on ((filesystem
12            and runlevel [!06]
13            and started dbus
14            and plymouth-ready)
15           or runlevel PREVLEVEL=S)
16
17 stop on runlevel [016]
18
19 respawn
20 respawn limit 2 15
21
22 emits login-session-start
23 emits desktop-session-start
24 emits desktop-shutdown
25
26 script
27     if [ -n "$UPSTART_EVENTS" ]
28     then
29         # Check kernel command-line for inhibitors, unless we are being called
30         # manually
31         for ARG in $(cat /proc/cmdline); do
32             if [ "$ARG" = "text" ]; then
33                 plymouth quit || : 
34                 stop
35                 exit 0
36             fi
37         done
38
39         [ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/bin/lightdm" -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] || { stop; exit 0; }
40
41         if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
42         then
43             # Single-user mode
44             plymouth quit || :
45             exit 0
46         fi
47     fi
48
49     exec lightdm
50 end script
51
52 post-start script
53     sleep 5
54     clear > /dev/tty7
55 end script
56
57 post-stop script
58         clear > /dev/tty7
59         sleep 1
60         if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
61                 initctl emit desktop-shutdown
62         fi
63 end script