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

Subscribers

People subscribed via source and target branches