~vanvugt/gdm/fix-1704050

« back to all changes in this revision

Viewing changes to debian/gdm3.upstart

  • Committer: Jeremy Bicha
  • Date: 2017-05-21 03:04:06 UTC
  • Revision ID: jbicha@ubuntu.com-20170521030406-l6tzhpfyacsam03y
Tags: 3.24.2-1ubuntu2
releasing package gdm3 version 3.24.2-1ubuntu2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# gdm - GNOME 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
 
description     "GNOME Display Manager"
7
 
author          "William Jon McCann <mccann@jhu.edu>"
8
 
 
9
 
start on ((filesystem
10
 
           and runlevel [!06]
11
 
           and started dbus
12
 
           and plymouth-ready)  
13
 
          or runlevel PREVLEVEL=S)
14
 
 
15
 
stop on runlevel [016]
16
 
 
17
 
emits login-session-start
18
 
emits desktop-session-start
19
 
emits desktop-shutdown
20
 
 
21
 
env XORGCONFIG=/etc/X11/xorg.conf
22
 
 
23
 
pre-start script
24
 
        # Try to dbus activate logind to avoid a race conditions if we are not
25
 
        # running systemd as PID1 (see: #747292)
26
 
    if [ ! -d /run/systemd/system ] && [ -x /lib/systemd/systemd-logind ]; then
27
 
        dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus \
28
 
        org.freedesktop.DBus.StartServiceByName string:org.freedesktop.login1 uint32:0 2>&1 > /dev/null || true
29
 
 
30
 
    fi
31
 
end script
32
 
 
33
 
script
34
 
    if [ -n "$UPSTART_EVENTS" ]
35
 
    then
36
 
        # Check kernel command-line for inhibitors, unless we are being called
37
 
        # manually
38
 
        for ARG in $(cat /proc/cmdline); do
39
 
            if [ "$ARG" = "text" ]; then
40
 
                plymouth quit || : 
41
 
                stop
42
 
                exit 0
43
 
            fi
44
 
        done
45
 
 
46
 
        if [ -f /etc/X11/default-display-manager ]; then
47
 
            [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/gdm3" ] || { stop; exit 0; }
48
 
        else
49
 
            type lightdm >/dev/null 2>&1 && { stop; exit 0; } || true
50
 
        fi
51
 
 
52
 
        if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
53
 
        then
54
 
            # Single-user mode
55
 
            plymouth quit || :
56
 
            exit 0
57
 
        fi
58
 
    fi
59
 
 
60
 
    test -f /etc/profile && . /etc/profile
61
 
 
62
 
    if [ -r /etc/default/locale ]; then
63
 
        . /etc/default/locale
64
 
        export LANG LANGUAGE LC_MESSAGES LC_ALL
65
 
    elif [ -r /etc/environment ]; then
66
 
        . /etc/environment
67
 
        export LANG LANGUAGE LC_MESSAGES LC_ALL
68
 
    fi
69
 
    export XORGCONFIG
70
 
 
71
 
    # update the dconf profile if needed
72
 
    /usr/share/gdm/generate-config
73
 
 
74
 
    exec gdm3 $CONFIG_FILE
75
 
end script
76
 
 
77
 
post-stop script
78
 
        if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
79
 
                initctl emit desktop-shutdown
80
 
        fi
81
 
end script