Merge lp:~mterry/unity8-desktop-session/copy-env into lp:unity8-desktop-session

Proposed by Michael Terry
Status: Merged
Approved by: Ken VanDine
Approved revision: 126
Merged at revision: 126
Proposed branch: lp:~mterry/unity8-desktop-session/copy-env
Merge into: lp:unity8-desktop-session
Diff against target: 67 lines (+37/-0)
3 files modified
data/Makefile.am (+4/-0)
data/unity8-copy-env.conf (+32/-0)
debian/unity8-desktop-session.install (+1/-0)
To merge this branch: bzr merge lp:~mterry/unity8-desktop-session/copy-env
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+320848@code.launchpad.net

Commit message

Copy our upstart environment into dbus and systemd, making sure that activated services have the correct environment.

Description of the change

As noted in the comments for the upstart job, this is a temporary solution. We are actively working on dropping upstart altogether. But I didn't want to block bug 1675437 and silos that are moving bits to systemd on us getting the last piece in place.

So this just manually does the copying for now, after unity8 starts. We'll need to revamp this when we drop upstart obviously.

(Testing note: the systemd portion of this does not work in xenial -- or at least xenial+overlay. The dbus API for xenial's systemd doesn't work.)

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I think this is a reasonable solution for now. I've tested this on a clean zesty install, works great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/Makefile.am'
2--- data/Makefile.am 2016-09-13 16:38:27 +0000
3+++ data/Makefile.am 2017-03-23 18:15:34 +0000
4@@ -19,6 +19,7 @@
5 lightdmdir = ${datadir}/lightdm
6 lightdm_confdir = ${lightdmdir}/lightdm.conf.d
7 lightdm_sessiondir = ${lightdmdir}/sessions
8+upstart_sessiondir = ${datadir}/upstart/sessions
9
10 dist_pkgdata_DATA = \
11 sensors.txt
12@@ -37,6 +38,9 @@
13 dist_bin_SCRIPTS = \
14 lightdm-unity8-session
15
16+dist_upstart_session_DATA = \
17+ unity8-copy-env.conf
18+
19 EXTRA_DIST = \
20 unity8.desktop.in
21
22
23=== added file 'data/unity8-copy-env.conf'
24--- data/unity8-copy-env.conf 1970-01-01 00:00:00 +0000
25+++ data/unity8-copy-env.conf 2017-03-23 18:15:34 +0000
26@@ -0,0 +1,32 @@
27+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*-
28+
29+description "Copy Upstart Environment for Unity 8"
30+author "Michael Terry <mterry@ubuntu.com>"
31+
32+start on started unity8
33+task
34+
35+script
36+ # Share our upstart env with dbus and systemd, so all activated services
37+ # and applications will have the same environment. This was originally done
38+ # to make sure everyone has QT_QPA_PLATFORM, but other vars are likely useful
39+ # too.
40+
41+ # FIXME: This script should go away shortly. In the short term, it should be
42+ # replaced by just doing everything in systemd directly and adjusting how
43+ # unity8 configures its environment. In the long term, everything will be
44+ # a snap and not need external environment variables to be set. But in the
45+ # very immediate term, this helps avoid regressions as we migrate away from
46+ # upstart.
47+
48+ # (script is copied from /etc/X11/Xsession.d/95dbus_update-activation-env)
49+
50+ # unset login-session-specifics
51+ unset XDG_SEAT
52+ unset XDG_SESSION_ID
53+ unset XDG_VTNR
54+
55+ # tell dbus-daemon --session (and systemd --user, if running)
56+ # to put our environment in activated services' environments
57+ dbus-update-activation-environment --verbose --systemd --all
58+end script
59
60=== modified file 'debian/unity8-desktop-session.install'
61--- debian/unity8-desktop-session.install 2016-07-26 13:10:53 +0000
62+++ debian/unity8-desktop-session.install 2017-03-23 18:15:34 +0000
63@@ -3,3 +3,4 @@
64 usr/share/lightdm/sessions/unity8.desktop
65 usr/share/unity-greeter/custom_unity8_badge.png
66 usr/share/unity8-desktop-session/sensors.txt
67+usr/share/upstart/sessions/unity8-copy-env.conf

Subscribers

People subscribed via source and target branches