Status: | Work in progress |
---|---|
Proposed branch: | lp:~mterry/unity8/systemd |
Merge into: | lp:unity8 |
Diff against target: |
432 lines (+98/-150) 17 files modified
data/unity8-dash.conf (+0/-25) data/unity8-dash.service (+15/-0) data/unity8-filewatcher.conf (+0/-13) data/unity8-session (+46/-0) data/unity8.conf (+0/-82) data/unity8.service (+15/-0) debian/control (+4/-1) debian/rules (+1/-1) debian/unity8.install (+3/-3) plugins/Unity/Launcher/dbusinterface.cpp (+2/-0) plugins/Unity/Session/dbusunitysessionservice.cpp (+5/-11) tests/plugins/Unity/Session/CMakeLists.txt (+1/-0) tests/plugins/Unity/Session/LogindServer.cpp (+0/-5) tests/plugins/Unity/Session/LogindServer.h (+0/-1) tests/plugins/Unity/Session/interfaces.xml (+0/-4) tests/plugins/Unity/Session/server.cpp (+1/-1) tests/plugins/Unity/Session/sessionbackendtest.cpp (+5/-3) |
To merge this branch: | bzr merge lp:~mterry/unity8/systemd |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+321557@code.launchpad.net |
Commit message
WIP
Description of the change
To post a comment you must log in.
lp:~mterry/unity8/systemd
updated
- 2894. By Michael Terry
-
Fix up some packaging bits
- 2895. By Michael Terry
-
Add missing service file
Unmerged revisions
- 2895. By Michael Terry
-
Add missing service file
- 2894. By Michael Terry
-
Fix up some packaging bits
- 2893. By Michael Terry
-
Fix trapping of STOP
- 2892. By Michael Terry
-
First (unfinished) pass at systemd unit for unity8
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file 'data/unity8-dash.conf' | |||
2 | --- data/unity8-dash.conf 2016-10-07 17:22:21 +0000 | |||
3 | +++ data/unity8-dash.conf 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,25 +0,0 @@ | |||
5 | 1 | description "Unity Shell v8 Dash" | ||
6 | 2 | author "Michael Zanetti <michael.zanetti@canonical.com>" | ||
7 | 3 | |||
8 | 4 | emits scope-ui-starting | ||
9 | 5 | |||
10 | 6 | start on started unity8 | ||
11 | 7 | stop on stopping unity8 | ||
12 | 8 | |||
13 | 9 | kill timeout 120 | ||
14 | 10 | |||
15 | 11 | # Focused app is 100 so we want to be less likely to get | ||
16 | 12 | # killed than the focused app but more than Unity8 | ||
17 | 13 | |||
18 | 14 | oom score 50 | ||
19 | 15 | |||
20 | 16 | respawn | ||
21 | 17 | respawn limit unlimited | ||
22 | 18 | |||
23 | 19 | env APP_ID=unity8-dash | ||
24 | 20 | |||
25 | 21 | pre-start script | ||
26 | 22 | initctl emit scope-ui-starting | ||
27 | 23 | end script | ||
28 | 24 | |||
29 | 25 | exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop | ||
30 | 26 | 0 | ||
31 | === added file 'data/unity8-dash.service' | |||
32 | --- data/unity8-dash.service 1970-01-01 00:00:00 +0000 | |||
33 | +++ data/unity8-dash.service 2017-04-03 17:54:55 +0000 | |||
34 | @@ -0,0 +1,15 @@ | |||
35 | 1 | [Unit] | ||
36 | 2 | Description=Unity Shell v8 Dash | ||
37 | 3 | PartOf=graphical-session.target | ||
38 | 4 | BindsTo=unity8.service | ||
39 | 5 | After=unity8.service | ||
40 | 6 | |||
41 | 7 | [Service] | ||
42 | 8 | ExecStart=/usr/bin/unity8-dash --desktop_file_hint=unity8-dash | ||
43 | 9 | Restart=always | ||
44 | 10 | TimeoutStartSec=120 | ||
45 | 11 | Environment=APP_ID=unity8-dash | ||
46 | 12 | |||
47 | 13 | # Focused app is 100 so we want to be less likely to get | ||
48 | 14 | # killed than the focused app but more than Unity8 | ||
49 | 15 | OOMScoreAdjust=50 | ||
50 | 0 | 16 | ||
51 | === removed file 'data/unity8-filewatcher.conf' | |||
52 | --- data/unity8-filewatcher.conf 2016-10-07 17:22:21 +0000 | |||
53 | +++ data/unity8-filewatcher.conf 1970-01-01 00:00:00 +0000 | |||
54 | @@ -1,13 +0,0 @@ | |||
55 | 1 | description "File system watcher for unity8" | ||
56 | 2 | author "Michael Zanetti <michael.zanetti@canonical.com>" | ||
57 | 3 | |||
58 | 4 | # This method of updating the launcher will not work in our new snappy world, | ||
59 | 5 | # neither for snaps installed in the system nor if we are running inside a snap. | ||
60 | 6 | # Plus it hardcodes the phablet user... To be replaced once bug 1630997 is | ||
61 | 7 | # fixed in ubuntu-app-launch. | ||
62 | 8 | |||
63 | 9 | # Workaround for bug 1360208. ~ and * in one expression doesn't work currently | ||
64 | 10 | start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop) | ||
65 | 11 | |||
66 | 12 | exec dbus-send --type=method_call --dest=com.canonical.Unity.Launcher /com/canonical/Unity/Launcher com.canonical.Unity.Launcher.Refresh | ||
67 | 13 | |||
68 | 14 | 0 | ||
69 | === added file 'data/unity8-session' | |||
70 | --- data/unity8-session 1970-01-01 00:00:00 +0000 | |||
71 | +++ data/unity8-session 2017-04-03 17:54:55 +0000 | |||
72 | @@ -0,0 +1,46 @@ | |||
73 | 1 | #!/bin/sh | ||
74 | 2 | # -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*- | ||
75 | 3 | |||
76 | 4 | # Ensure the shell always gets unthrottled touch events, so that applications | ||
77 | 5 | # who want full speed low-latency input can get it (LP: #1497105) and so that | ||
78 | 6 | # apps can use QML touch compression safely (the QML touch compression | ||
79 | 7 | # algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so | ||
80 | 8 | # must be fed by the raw input event stream from Unity8). | ||
81 | 9 | export QML_NO_TOUCH_COMPRESSION=1 | ||
82 | 10 | |||
83 | 11 | export MIR_SERVER_PROMPT_FILE=1 | ||
84 | 12 | |||
85 | 13 | # Hard code socket path because our snappy apparmor profile | ||
86 | 14 | # only lets us put the socket in one place. And consumers expect it there. | ||
87 | 15 | # (XDG_RUNTIME_DIR isn't typical under snappy) | ||
88 | 16 | export MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket | ||
89 | 17 | |||
90 | 18 | rm -f "$MIR_SERVER_FILE" | ||
91 | 19 | rm -f "${MIR_SERVER_FILE}_trusted" | ||
92 | 20 | |||
93 | 21 | if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then | ||
94 | 22 | # On Ubuntu Touch, we currently use a trick where we auto-login the | ||
95 | 23 | # user without a LightDM greeter at all. In this case, we want to | ||
96 | 24 | # start with the lockscreen visible. Once we switch to using a | ||
97 | 25 | # proper greeter for the first login, we can remove this code path. | ||
98 | 26 | MODE=full-greeter | ||
99 | 27 | else | ||
100 | 28 | MODE=full-shell | ||
101 | 29 | fi | ||
102 | 30 | |||
103 | 31 | dbus-update-activation-environment --systemd MIR_SOCKET=$MIR_SERVER_FILE | ||
104 | 32 | |||
105 | 33 | # Tell unity-mir to raise SIGSTOP after we start, which we use to tell | ||
106 | 34 | # systemd when we are done starting up. | ||
107 | 35 | export UNITY_MIR_EMITS_SIGSTOP=1 | ||
108 | 36 | |||
109 | 37 | ${BINARY:-unity8} --mode=$MODE "$@" & | ||
110 | 38 | child=$! | ||
111 | 39 | |||
112 | 40 | # Wait for SIGSTOP in child | ||
113 | 41 | while [ $(ps --no-headers -o state $child) != "T" ]; do | ||
114 | 42 | sleep 0.1 | ||
115 | 43 | done | ||
116 | 44 | |||
117 | 45 | kill -CONT $child | ||
118 | 46 | exit 0 | ||
119 | 0 | 47 | ||
120 | === removed file 'data/unity8.conf' | |||
121 | --- data/unity8.conf 2017-02-08 15:46:18 +0000 | |||
122 | +++ data/unity8.conf 1970-01-01 00:00:00 +0000 | |||
123 | @@ -1,82 +0,0 @@ | |||
124 | 1 | description "Unity Shell v8" | ||
125 | 2 | author "Ricardo Mendoza <ricmm@ubuntu.com>" | ||
126 | 3 | |||
127 | 4 | emits indicator-services-start | ||
128 | 5 | |||
129 | 6 | start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir) or (xsession SESSION=unity8)) and started dbus | ||
130 | 7 | stop on desktop-end | ||
131 | 8 | |||
132 | 9 | kill timeout 120 | ||
133 | 10 | |||
134 | 11 | # | ||
135 | 12 | # Ensure the shell always gets unthrottled touch events, so that applications | ||
136 | 13 | # who want full speed low-latency input can get it (LP: #1497105) and so that | ||
137 | 14 | # apps can use QML touch compression safely (the QML touch compression | ||
138 | 15 | # algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so | ||
139 | 16 | # must be fed by the raw input event stream from Unity8). | ||
140 | 17 | # | ||
141 | 18 | env QML_NO_TOUCH_COMPRESSION=1 | ||
142 | 19 | |||
143 | 20 | respawn | ||
144 | 21 | expect stop | ||
145 | 22 | |||
146 | 23 | # FIXME Create an autopilot test that makes sure start+stop and restart | ||
147 | 24 | # work fine at least 2 times | ||
148 | 25 | |||
149 | 26 | pre-start script | ||
150 | 27 | # Tell unity-mir to raise SIGSTOP after we start | ||
151 | 28 | initctl set-env UNITY_MIR_EMITS_SIGSTOP=1 | ||
152 | 29 | |||
153 | 30 | # Save original value of MIR_SOCKET so that we can restore it when stopped, | ||
154 | 31 | # as we modify the variable for future jobs, including ourself. | ||
155 | 32 | initctl set-env UNITY_MIR_SOCKET=$MIR_SOCKET | ||
156 | 33 | |||
157 | 34 | # Decide where we are going to put our own socket file | ||
158 | 35 | if [ -n "$SNAP" ]; then | ||
159 | 36 | # In snappy, we want to hard code our path because our apparmor profile | ||
160 | 37 | # only lets us put the socket in one place. And consumers expect it | ||
161 | 38 | # there. | ||
162 | 39 | MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket | ||
163 | 40 | else | ||
164 | 41 | MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket | ||
165 | 42 | fi | ||
166 | 43 | initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE | ||
167 | 44 | |||
168 | 45 | # Point all future jobs in this session to our Mir socket instead of | ||
169 | 46 | # unity-system-compositor's socket. | ||
170 | 47 | initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE | ||
171 | 48 | gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}" | ||
172 | 49 | |||
173 | 50 | # Remove the normal and trusted sockets if still there | ||
174 | 51 | if [ -S "$MIR_SERVER_FILE" ]; then | ||
175 | 52 | rm "$MIR_SERVER_FILE" | ||
176 | 53 | fi | ||
177 | 54 | |||
178 | 55 | if [ -S "${MIR_SERVER_FILE}_trusted" ]; then | ||
179 | 56 | rm "${MIR_SERVER_FILE}_trusted" | ||
180 | 57 | fi | ||
181 | 58 | |||
182 | 59 | initctl set-env --global MIR_SERVER_PROMPT_FILE=1 | ||
183 | 60 | |||
184 | 61 | if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then | ||
185 | 62 | # On Ubuntu Touch, we currently use a trick where we auto-login the | ||
186 | 63 | # user without a LightDM greeter at all. In this case, we want to | ||
187 | 64 | # start with the lockscreen visible. Once we switch to using a | ||
188 | 65 | # proper greeter for the first login, we can remove this code path. | ||
189 | 66 | initctl set-env MODE=full-greeter | ||
190 | 67 | else | ||
191 | 68 | initctl set-env MODE=full-shell | ||
192 | 69 | fi | ||
193 | 70 | end script | ||
194 | 71 | |||
195 | 72 | exec ${BINARY:-unity8} --mode=$MODE $ARGS | ||
196 | 73 | |||
197 | 74 | post-start script | ||
198 | 75 | initctl emit --no-wait indicator-services-start | ||
199 | 76 | end script | ||
200 | 77 | |||
201 | 78 | post-stop script | ||
202 | 79 | initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET | ||
203 | 80 | initctl unset-env --global MIR_SERVER_PROMPT_FILE | ||
204 | 81 | initctl emit application-end | ||
205 | 82 | end script | ||
206 | 83 | 0 | ||
207 | === added file 'data/unity8.service' | |||
208 | --- data/unity8.service 1970-01-01 00:00:00 +0000 | |||
209 | +++ data/unity8.service 2017-04-03 17:54:55 +0000 | |||
210 | @@ -0,0 +1,15 @@ | |||
211 | 1 | [Unit] | ||
212 | 2 | Description=Unity Shell v8 | ||
213 | 3 | PartOf=graphical-session.target | ||
214 | 4 | Requires=dbus.socket | ||
215 | 5 | After=dbus.socket | ||
216 | 6 | Before=indicators.target | ||
217 | 7 | Wants=unity8-dash.service | ||
218 | 8 | Wants=indicators.target | ||
219 | 9 | |||
220 | 10 | [Service] | ||
221 | 11 | Type=forking | ||
222 | 12 | ExecStart=/usr/bin/unity8-session | ||
223 | 13 | ExecStopPost=/usr/bin/dbus-update-activation-environment --systemd MIR_SOCKET= | ||
224 | 14 | Restart=on-failure | ||
225 | 15 | TimeoutStartSec=120 | ||
226 | 0 | 16 | ||
227 | === modified file 'debian/control' | |||
228 | --- debian/control 2017-03-20 10:19:11 +0000 | |||
229 | +++ debian/control 2017-04-03 17:54:55 +0000 | |||
230 | @@ -6,6 +6,7 @@ | |||
231 | 6 | dbus-test-runner, | 6 | dbus-test-runner, |
232 | 7 | debhelper (>= 9), | 7 | debhelper (>= 9), |
233 | 8 | dh-apparmor, | 8 | dh-apparmor, |
234 | 9 | dh-systemd, | ||
235 | 9 | doxyqml, | 10 | doxyqml, |
236 | 10 | # To allow cross-compiling to work, we also must append :native | 11 | # To allow cross-compiling to work, we also must append :native |
237 | 11 | # to g++ so we don't try to run arm g++ | 12 | # to g++ so we don't try to run arm g++ |
238 | @@ -71,6 +72,7 @@ | |||
239 | 71 | qtdeclarative5-private-dev (>= 5.6), | 72 | qtdeclarative5-private-dev (>= 5.6), |
240 | 72 | qtdeclarative5-ubuntu-content1, | 73 | qtdeclarative5-ubuntu-content1, |
241 | 73 | qtdeclarative5-ubuntu-settings-components (>= 0.11), | 74 | qtdeclarative5-ubuntu-settings-components (>= 0.11), |
242 | 75 | systemd, | ||
243 | 74 | ttf-ubuntu-font-family, | 76 | ttf-ubuntu-font-family, |
244 | 75 | xvfb, | 77 | xvfb, |
245 | 76 | Standards-Version: 3.9.4 | 78 | Standards-Version: 3.9.4 |
246 | @@ -120,7 +122,8 @@ | |||
247 | 120 | Package: unity8 | 122 | Package: unity8 |
248 | 121 | Architecture: any | 123 | Architecture: any |
249 | 122 | Provides: indicator-renderer, | 124 | Provides: indicator-renderer, |
251 | 123 | Depends: dmz-cursor-theme, | 125 | Depends: dbus, |
252 | 126 | dmz-cursor-theme, | ||
253 | 124 | gsettings-desktop-schemas, | 127 | gsettings-desktop-schemas, |
254 | 125 | libcap2-bin, | 128 | libcap2-bin, |
255 | 126 | libglib2.0-bin, | 129 | libglib2.0-bin, |
256 | 127 | 130 | ||
257 | === modified file 'debian/rules' | |||
258 | --- debian/rules 2017-01-18 00:25:13 +0000 | |||
259 | +++ debian/rules 2017-04-03 17:54:55 +0000 | |||
260 | @@ -9,7 +9,7 @@ | |||
261 | 9 | export NO_PNG_PKG_MANGLE=1 | 9 | export NO_PNG_PKG_MANGLE=1 |
262 | 10 | 10 | ||
263 | 11 | %: | 11 | %: |
265 | 12 | dh $@ --parallel --fail-missing --with python3 | 12 | dh $@ --parallel --fail-missing --with python3,systemd |
266 | 13 | 13 | ||
267 | 14 | override_dh_auto_configure: | 14 | override_dh_auto_configure: |
268 | 15 | # Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong. | 15 | # Debian defines CMAKE_INSTALL_LOCALSTATEDIR as /usr/var, which is wrong. |
269 | 16 | 16 | ||
270 | === modified file 'debian/unity8.install' | |||
271 | --- debian/unity8.install 2016-10-04 16:21:38 +0000 | |||
272 | +++ debian/unity8.install 2017-04-03 17:54:55 +0000 | |||
273 | @@ -1,8 +1,8 @@ | |||
274 | 1 | debian/usr.bin.unity8-dash etc/apparmor.d | 1 | debian/usr.bin.unity8-dash etc/apparmor.d |
275 | 2 | var/lib/unity8/version | 2 | var/lib/unity8/version |
279 | 3 | data/unity8-dash.conf usr/share/upstart/sessions/ | 3 | data/unity8.service usr/lib/systemd/user |
280 | 4 | data/unity8-filewatcher.conf usr/share/upstart/sessions/ | 4 | data/unity8-dash.service usr/lib/systemd/user |
281 | 5 | data/unity8.conf usr/share/upstart/sessions/ | 5 | data/unity8-session usr/bin |
282 | 6 | data/devices.conf etc/ubuntu/ | 6 | data/devices.conf etc/ubuntu/ |
283 | 7 | usr/bin/unity8 | 7 | usr/bin/unity8 |
284 | 8 | usr/bin/unity8-dash | 8 | usr/bin/unity8-dash |
285 | 9 | 9 | ||
286 | === modified file 'plugins/Unity/Launcher/dbusinterface.cpp' | |||
287 | --- plugins/Unity/Launcher/dbusinterface.cpp 2015-11-20 15:01:39 +0000 | |||
288 | +++ plugins/Unity/Launcher/dbusinterface.cpp 2017-04-03 17:54:55 +0000 | |||
289 | @@ -39,6 +39,8 @@ | |||
290 | 39 | QString nodes; | 39 | QString nodes; |
291 | 40 | 40 | ||
292 | 41 | // Add Refresh to introspect | 41 | // Add Refresh to introspect |
293 | 42 | // TODO: Confirm this is still used anywhere and remove if not. | ||
294 | 43 | // It used to be used in an upstart job when desktop fles changed. | ||
295 | 42 | nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">" | 44 | nodes = QStringLiteral("<interface name=\"com.canonical.Unity.Launcher\">" |
296 | 43 | "<method name=\"Refresh\"/>" | 45 | "<method name=\"Refresh\"/>" |
297 | 44 | "</interface>"); | 46 | "</interface>"); |
298 | 45 | 47 | ||
299 | === modified file 'plugins/Unity/Session/dbusunitysessionservice.cpp' | |||
300 | --- plugins/Unity/Session/dbusunitysessionservice.cpp 2017-03-21 10:51:38 +0000 | |||
301 | +++ plugins/Unity/Session/dbusunitysessionservice.cpp 2017-04-03 17:54:55 +0000 | |||
302 | @@ -36,6 +36,7 @@ | |||
303 | 36 | 36 | ||
304 | 37 | #define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1") | 37 | #define LOGIN1_SERVICE QStringLiteral("org.freedesktop.login1") |
305 | 38 | #define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1") | 38 | #define LOGIN1_PATH QStringLiteral("/org/freedesktop/login1") |
306 | 39 | #define LOGIN1_SESSION_ROOT QStringLiteral("/org/freedesktop/login1/session/") | ||
307 | 39 | #define LOGIN1_IFACE QStringLiteral("org.freedesktop.login1.Manager") | 40 | #define LOGIN1_IFACE QStringLiteral("org.freedesktop.login1.Manager") |
308 | 40 | #define LOGIN1_SESSION_IFACE QStringLiteral("org.freedesktop.login1.Session") | 41 | #define LOGIN1_SESSION_IFACE QStringLiteral("org.freedesktop.login1.Session") |
309 | 41 | 42 | ||
310 | @@ -58,16 +59,9 @@ | |||
311 | 58 | 59 | ||
312 | 59 | void init() | 60 | void init() |
313 | 60 | { | 61 | { |
324 | 61 | // get our logind session path | 62 | QString sessionID = QString::fromLocal8Bit(qgetenv("XDG_SESSION_ID")); |
325 | 62 | QDBusMessage msg = QDBusMessage::createMethodCall(LOGIN1_SERVICE, | 63 | if (!sessionID.isEmpty()) { |
326 | 63 | LOGIN1_PATH, | 64 | logindSessionPath = LOGIN1_SESSION_ROOT + sessionID; |
317 | 64 | LOGIN1_IFACE, | ||
318 | 65 | QStringLiteral("GetSessionByPID")); | ||
319 | 66 | msg << (quint32) getpid(); | ||
320 | 67 | |||
321 | 68 | QDBusReply<QDBusObjectPath> reply = QDBusConnection::SM_BUSNAME().call(msg); | ||
322 | 69 | if (reply.isValid()) { | ||
323 | 70 | logindSessionPath = reply.value().path(); | ||
327 | 71 | 65 | ||
328 | 72 | // start watching the Active property | 66 | // start watching the Active property |
329 | 73 | QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"), | 67 | QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, logindSessionPath, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"), |
330 | @@ -79,7 +73,7 @@ | |||
331 | 79 | QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"), | 73 | QDBusConnection::SM_BUSNAME().connect(LOGIN1_SERVICE, LOGIN1_PATH, LOGIN1_IFACE, QStringLiteral("PrepareForSleep"), |
332 | 80 | this, SLOT(onResuming(bool))); | 74 | this, SLOT(onResuming(bool))); |
333 | 81 | } else { | 75 | } else { |
335 | 82 | qWarning() << "Failed to get logind session path" << reply.error().message(); | 76 | qWarning() << "Failed to get logind session: XDG_SESSION_ID is not set"; |
336 | 83 | } | 77 | } |
337 | 84 | } | 78 | } |
338 | 85 | 79 | ||
339 | 86 | 80 | ||
340 | === modified file 'tests/plugins/Unity/Session/CMakeLists.txt' | |||
341 | --- tests/plugins/Unity/Session/CMakeLists.txt 2017-03-14 18:51:23 +0000 | |||
342 | +++ tests/plugins/Unity/Session/CMakeLists.txt 2017-04-03 17:54:55 +0000 | |||
343 | @@ -60,6 +60,7 @@ | |||
344 | 60 | 60 | ||
345 | 61 | add_unity8_unittest(SessionBackend dbus-test-runner | 61 | add_unity8_unittest(SessionBackend dbus-test-runner |
346 | 62 | ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:SessionBackendTestPreload> | 62 | ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:SessionBackendTestPreload> |
347 | 63 | XDG_SESSION_ID=testing | ||
348 | 63 | XDG_SESSION_PATH=/session | 64 | XDG_SESSION_PATH=/session |
349 | 64 | ARG_PREFIX "--parameter" | 65 | ARG_PREFIX "--parameter" |
350 | 65 | ARGS | 66 | ARGS |
351 | 66 | 67 | ||
352 | === modified file 'tests/plugins/Unity/Session/LogindServer.cpp' | |||
353 | --- tests/plugins/Unity/Session/LogindServer.cpp 2017-03-15 21:31:32 +0000 | |||
354 | +++ tests/plugins/Unity/Session/LogindServer.cpp 2017-04-03 17:54:55 +0000 | |||
355 | @@ -22,11 +22,6 @@ | |||
356 | 22 | { | 22 | { |
357 | 23 | } | 23 | } |
358 | 24 | 24 | ||
359 | 25 | QDBusObjectPath LogindServer::GetSessionByPID(quint32) | ||
360 | 26 | { | ||
361 | 27 | return QDBusObjectPath("/logindsession"); | ||
362 | 28 | } | ||
363 | 29 | |||
364 | 30 | void LogindServer::Reboot(bool interactive) | 25 | void LogindServer::Reboot(bool interactive) |
365 | 31 | { | 26 | { |
366 | 32 | Q_EMIT RebootCalled(interactive); | 27 | Q_EMIT RebootCalled(interactive); |
367 | 33 | 28 | ||
368 | === modified file 'tests/plugins/Unity/Session/LogindServer.h' | |||
369 | --- tests/plugins/Unity/Session/LogindServer.h 2017-03-15 21:31:32 +0000 | |||
370 | +++ tests/plugins/Unity/Session/LogindServer.h 2017-04-03 17:54:55 +0000 | |||
371 | @@ -30,7 +30,6 @@ | |||
372 | 30 | explicit LogindServer(QObject *parent = nullptr); | 30 | explicit LogindServer(QObject *parent = nullptr); |
373 | 31 | 31 | ||
374 | 32 | public Q_SLOTS: | 32 | public Q_SLOTS: |
375 | 33 | QDBusObjectPath GetSessionByPID(quint32 pid); | ||
376 | 34 | void Reboot(bool interactive); | 33 | void Reboot(bool interactive); |
377 | 35 | void PowerOff(bool interactive); | 34 | void PowerOff(bool interactive); |
378 | 36 | 35 | ||
379 | 37 | 36 | ||
380 | === modified file 'tests/plugins/Unity/Session/interfaces.xml' | |||
381 | --- tests/plugins/Unity/Session/interfaces.xml 2017-03-15 21:31:32 +0000 | |||
382 | +++ tests/plugins/Unity/Session/interfaces.xml 2017-04-03 17:54:55 +0000 | |||
383 | @@ -3,10 +3,6 @@ | |||
384 | 3 | <method name="Lock" /> | 3 | <method name="Lock" /> |
385 | 4 | </interface> | 4 | </interface> |
386 | 5 | <interface name="org.freedesktop.login1.Manager"> | 5 | <interface name="org.freedesktop.login1.Manager"> |
387 | 6 | <method name="GetSessionByPID"> | ||
388 | 7 | <arg name="pid" type="u" direction="in" /> | ||
389 | 8 | <arg name="session" type="o" direction="out" /> | ||
390 | 9 | </method> | ||
391 | 10 | <method name="Reboot"> | 6 | <method name="Reboot"> |
392 | 11 | <arg name="interactive" type="b" direction="in" /> | 7 | <arg name="interactive" type="b" direction="in" /> |
393 | 12 | </method> | 8 | </method> |
394 | 13 | 9 | ||
395 | === modified file 'tests/plugins/Unity/Session/server.cpp' | |||
396 | --- tests/plugins/Unity/Session/server.cpp 2016-06-21 14:23:49 +0000 | |||
397 | +++ tests/plugins/Unity/Session/server.cpp 2017-04-03 17:54:55 +0000 | |||
398 | @@ -37,7 +37,7 @@ | |||
399 | 37 | auto connection = QDBusConnection::sessionBus(); | 37 | auto connection = QDBusConnection::sessionBus(); |
400 | 38 | if (!connection.registerObject("/org/freedesktop/login1", logind)) | 38 | if (!connection.registerObject("/org/freedesktop/login1", logind)) |
401 | 39 | return 1; | 39 | return 1; |
403 | 40 | if (!connection.registerObject("/logindsession", logind)) | 40 | if (!connection.registerObject("/org/freedesktop/login1/session/testing", logind)) |
404 | 41 | return 1; | 41 | return 1; |
405 | 42 | if (!connection.registerService("org.freedesktop.login1")) | 42 | if (!connection.registerService("org.freedesktop.login1")) |
406 | 43 | return 1; | 43 | return 1; |
407 | 44 | 44 | ||
408 | === modified file 'tests/plugins/Unity/Session/sessionbackendtest.cpp' | |||
409 | --- tests/plugins/Unity/Session/sessionbackendtest.cpp 2017-03-21 10:51:38 +0000 | |||
410 | +++ tests/plugins/Unity/Session/sessionbackendtest.cpp 2017-04-03 17:54:55 +0000 | |||
411 | @@ -103,8 +103,8 @@ | |||
412 | 103 | QCoreApplication::processEvents(); // to let the services register on DBus | 103 | QCoreApplication::processEvents(); // to let the services register on DBus |
413 | 104 | 104 | ||
414 | 105 | QDBusInterface login1Interface("org.freedesktop.login1", | 105 | QDBusInterface login1Interface("org.freedesktop.login1", |
417 | 106 | "/logindsession", | 106 | "/org/freedesktop/login1/session/testing", |
418 | 107 | "org.freedesktop.login1.Manager"); | 107 | "org.freedesktop.login1.Manager"); |
419 | 108 | QSignalSpy spy(&login1Interface, signal.toUtf8().data()); | 108 | QSignalSpy spy(&login1Interface, signal.toUtf8().data()); |
420 | 109 | 109 | ||
421 | 110 | QDBusInterface dbusGnomeSessionWrapper("org.gnome.SessionManager", | 110 | QDBusInterface dbusGnomeSessionWrapper("org.gnome.SessionManager", |
422 | @@ -225,7 +225,9 @@ | |||
423 | 225 | DBusUnitySessionService dbusUnitySessionService; | 225 | DBusUnitySessionService dbusUnitySessionService; |
424 | 226 | QCoreApplication::processEvents(); // to let the service register on DBus | 226 | QCoreApplication::processEvents(); // to let the service register on DBus |
425 | 227 | 227 | ||
427 | 228 | QDBusInterface iface("org.freedesktop.login1", "/logindsession", "org.freedesktop.login1.Session"); | 228 | QDBusInterface iface("org.freedesktop.login1", |
428 | 229 | "/org/freedesktop/login1/session/testing", | ||
429 | 230 | "org.freedesktop.login1.Session"); | ||
430 | 229 | QVERIFY(iface.isValid()); | 231 | QVERIFY(iface.isValid()); |
431 | 230 | 232 | ||
432 | 231 | QSignalSpy spy(&dbusUnitySessionService, SIGNAL(Unlocked())); | 233 | QSignalSpy spy(&dbusUnitySessionService, SIGNAL(Unlocked())); |