~didrocks/lightdm/packaging-cleanup

« back to all changes in this revision

Viewing changes to debian/lightdm.upstart

  • Committer: Robert Ancell
  • Date: 2013-04-30 19:12:50 UTC
  • Revision ID: robert.ancell@canonical.com-20130430191250-g7tj2exduq8bc3ri
Add packaging

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
emits login-session-start
 
20
emits desktop-session-start
 
21
emits desktop-shutdown
 
22
 
 
23
script
 
24
    if [ -n "$UPSTART_EVENTS" ]
 
25
    then
 
26
        # Check kernel command-line for inhibitors, unless we are being called
 
27
        # manually
 
28
        for ARG in $(cat /proc/cmdline); do
 
29
            if [ "$ARG" = "text" ]; then
 
30
                plymouth quit || : 
 
31
                stop
 
32
                exit 0
 
33
            fi
 
34
        done
 
35
 
 
36
        [ ! -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; }
 
37
 
 
38
        if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
 
39
        then
 
40
            # Single-user mode
 
41
            plymouth quit || :
 
42
            exit 0
 
43
        fi
 
44
    fi
 
45
 
 
46
    exec lightdm
 
47
end script
 
48
 
 
49
post-start script
 
50
    sleep 5
 
51
    clear > /dev/tty7
 
52
end script
 
53
 
 
54
post-stop script
 
55
        if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
 
56
                initctl emit desktop-shutdown
 
57
        fi
 
58
end script