Merge lp:~ted/unity/systemd-unit. into lp:unity
- systemd-unit.
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~ted/unity/systemd-unit. |
Merge into: | lp:unity |
Prerequisite: | lp:~azzar1/unity/unity-active-plugins--safety-check |
Diff against target: |
741 lines (+433/-47) 25 files modified
CMakeLists.txt (+11/-1) debian/control (+22/-20) debian/libunity-core-6.0-9.install (+3/-2) debian/unity-services.install (+4/-1) debian/unity-services.links (+13/-0) debian/unity.install (+3/-0) lockscreen/LockScreenController.cpp (+4/-0) lockscreen/LockScreenController.h (+3/-0) services/CMakeLists.txt (+31/-0) services/unity-panel-service-lockscreen.override (+1/-0) services/unity-panel-service-lockscreen.service.in (+7/-0) services/unity-panel-service.override (+1/-0) services/unity-panel-service.service.in (+9/-0) services/unity-screen-locked.target (+4/-0) tests/CMakeLists.txt (+1/-0) tests/test_lockscreen_controller.cpp (+5/-2) tests/test_systemd_wrapper.cpp (+111/-0) tools/CMakeLists.txt (+3/-0) tools/unity-compiz-profile-select.in (+25/-0) unity-shared/CMakeLists.txt (+1/-0) unity-shared/SystemdWrapper.cpp (+103/-0) unity-shared/SystemdWrapper.h (+55/-0) unity7.conf.in (+1/-21) unity7.override (+1/-0) unity7.service.in (+11/-0) |
To merge this branch: | bzr merge lp:~ted/unity/systemd-unit. |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Iain Lane | Needs Fixing | ||
Marco Trevisan (Treviño) | Needs Fixing | ||
Review via email: mp+300624@code.launchpad.net |
This proposal supersedes a proposal from 2016-07-20.
This proposal has been superseded by a proposal from 2016-09-02.
Commit message
Adding systemd user session units
Description of the change
At it's core this MR is about making unity7 work with the systemd user sessions. It required a larger change than expected, so some descriptions :-)
It moves the prestart scripts from Upstart into a shared shell script so that both systemd and Upstart can use the same code.
Added a signal wrapper for Systemd, today we are sending both signals as both will be running for the time being. In the future the Upstart signals should be droppable.
For lock screen we created a target for when the lock screen is enabled. We put the panel job in there, but other jobs can add themselves by putting a symbolic link into the "unity-
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal | # |
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
I don't see unity-compiz-
Please move that into unity.install together with systemd (and unity7.conf file). I don't remember why they were added there in the past (likely for some gsettings and unity8 dependency on libunity-core), but I think that is not the nicest places to be.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Can you please merge this again with lp:~azzar1/unity/unity-active-plugins--safety-check?
It should be the last time :-)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
As per channel discussion:
15:15:38 <Trevinho> tedg: also, I was thinking... using that code in the current yakkety causes the Start/Stop calls to not happen since the proxy is not connected... They get queued though... Maybe you could avoid to call start/stop if the systemd_proxy_ is not connected?
15:16:37 <Trevinho> tedg: at the beginning I had the idea of just provinding one of the two wrappers, depending on what is running in the session, but... It's a little to annoying, and I didn't want you to create an abstract class just for that, but... Maybe...
15:16:55 <tedg> Trevinho: Oh, because it's connecting to the session bus instead of the user bus right now?
15:17:04 <Trevinho> tedg: yes
15:17:14 <tedg> Trevinho: We won't have the Upstart stuff for long hopefully, so I don't think it's worth abstracting.
15:18:18 <Trevinho> tedg: yeah, same I thought...
15:18:36 <Trevinho> tedg: but currently guess we'd get some "Timed out waiting for proxy" erros in unity logs
15:18:37 <Trevinho> so...
15:19:11 <Trevinho> tedg: is an env var available when systemd is there?
15:19:55 <tedg> tedg: I think checking if it's connected is fine. We can drop that too once we get migrated over if it's taking too long.
15:20:03 <Trevinho> ok...
15:20:30 <Trevinho> tedg: I mean, it might be not connected at the very start of the session... Like if starting with unity already locked (because of a crash) though
15:20:48 <Trevinho> but... Yeah, as you say, this is something we can get rid of
15:21:08 <Trevinho> or, juts check for an env var presency for both upstart and systemd wrappers
15:23:01 <Trevinho> tedg: also /usr/share/
15:24:04 <Trevinho> tedg: and probably renamed unity-compiz-
15:25:05 <tedg> K, I was avoiding changing the codebase too much, but since andyrock moved the .conf file into the build system we can move it to lib.
15:33:32 <Trevinho> tedg: yeah, that's nicer
Ted Gould (ted) wrote : | # |
K, I think that's everything :-)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Still some conflicts with the parent branch, merge again please...
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Also, you want me to land this or you prefer to land the branch together with the other systemd branches?
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Looks good, just still wondering if you can get rid of that static list from the .service :)
Ted Gould (ted) wrote : | # |
So I removed the list and put it as a set of symbolic links in the packaging. At least then it is a packaging thing (when suggests change the links should change) more than an Upstream thing.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Mh, this is better... I would have guessed this was done at each indicator level, but I can go with this too.
One only minor thing, it shouldn't never happen that the lockscreen is there without ups running, but... For safety I think it would be better to also add
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
Ted Gould (ted) wrote : | # |
On Tue, 2016-08-09 at 16:09 +0000, Marco Trevisan (Treviño) wrote:
> Mh, this is better... I would have guessed this was done at each
> indicator level, but I can go with this too.
Yes, systemd is "backwards" to Upstart in that you define a state and
how to achieve that state instead of an event that you listen for. So
the state is panel-service running and you achieve that by starting the
indicators instead of the panel service asking the indicators to start.
I miss Upstart, I think it made more sense too :-(
> One only minor thing, it shouldn't never happen that the lockscreen is there without ups running, but... For safety I think it would be better to also add
>
Yup, good idea, added.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Nice, I think we can land this now!
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ouch, I'm getting this now:
dpkg: error processing archive /tmp/apt-
trying to overwrite '/usr/lib/
I guess this is because the unity.install +usr/lib/*/unity line, can you set it as it used to be please?
Marco Trevisan (Treviño) (3v1n0) : | # |
Ted Gould (ted) wrote : | # |
Set them up to explicitly mention, looks like they end up in the right package now.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
I didn't generated scripts have wrong path, you should use FULL_LIBDIR.
[/usr/lib/
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
The prefixes on the .service and .config files are still wrong... See the inline comments.
Also unity7 doesn't start automatically (it does if I use systemctl manually), and I also see this:
indicator-
● indicator-
● indicator-
● indicator-
● indicator-
● indicator-
● indicator-
● indicator-
unity-
unity-
unity-
unity7.service loaded inactive dead Unity Shell v7
indicators-
Iain Lane (laney) wrote : | # |
Missing:
- symlink /usr/lib/
- Environment=
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
> - Environment=
This isn't true anymore, since the profile could also be ubnutu-lowgfx, so this has to be done from the pre-start script
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
> - Environment=
This isn't true anymore, since the profile could also be ubnutu-lowgfx, so this has to be done from the pre-start script
Iain Lane (laney) wrote : | # |
On Wed, Aug 31, 2016 at 10:54:22AM -0000, Marco Trevisan (Treviño) wrote:
> > - Environment=
>
> This isn't true anymore, since the profile could also be ubnutu-lowgfx, so this has to be done from the pre-start script
Then make that call dbus-update-
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Iain Lane (laney) wrote : | # |
On Wed, Aug 31, 2016 at 11:03:38AM -0000, Iain Lane wrote:
> On Wed, Aug 31, 2016 at 10:54:22AM -0000, Marco Trevisan (Treviño) wrote:
> > > - Environment=
> >
> > This isn't true anymore, since the profile could also be ubnutu-lowgfx, so this has to be done from the pre-start script
>
> Then make that call dbus-update-
instead of systemctl set-environment, that is. Most jobs do
initctl set-env -g ...
dbus-
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-07-21 13:01:59 +0000 | |||
3 | +++ CMakeLists.txt 2016-08-31 03:25:56 +0000 | |||
4 | @@ -429,5 +429,15 @@ | |||
5 | 429 | # | 429 | # |
6 | 430 | # Upstart | 430 | # Upstart |
7 | 431 | # | 431 | # |
9 | 432 | configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf) | 432 | |
10 | 433 | configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf @ONLY) | ||
11 | 433 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) | 434 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) |
12 | 435 | |||
13 | 436 | # | ||
14 | 437 | # Systemd | ||
15 | 438 | # | ||
16 | 439 | |||
17 | 440 | configure_file(unity7.service.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.service @ONLY) | ||
18 | 441 | pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) | ||
19 | 442 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.service DESTINATION ${SYSTEMD_USER_DIR}) | ||
20 | 443 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unity7.override DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/systemd-session/upstart) | ||
21 | 434 | 444 | ||
22 | === modified file 'debian/control' | |||
23 | --- debian/control 2016-07-25 18:20:16 +0000 | |||
24 | +++ debian/control 2016-08-31 03:25:56 +0000 | |||
25 | @@ -53,6 +53,7 @@ | |||
26 | 53 | python3 (>= 3.4), | 53 | python3 (>= 3.4), |
27 | 54 | python-setuptools, | 54 | python-setuptools, |
28 | 55 | quilt, | 55 | quilt, |
29 | 56 | systemd, | ||
30 | 56 | xserver-xorg-video-dummy, | 57 | xserver-xorg-video-dummy, |
31 | 57 | xsltproc, | 58 | xsltproc, |
32 | 58 | Standards-Version: 3.9.5 | 59 | Standards-Version: 3.9.5 |
33 | @@ -81,12 +82,31 @@ | |||
34 | 81 | libxfixes3 (>= 1:5.0.1-1), | 82 | libxfixes3 (>= 1:5.0.1-1), |
35 | 82 | libxi6 (>= 2:1.7.1.901), | 83 | libxi6 (>= 2:1.7.1.901), |
36 | 83 | unity-scope-home, | 84 | unity-scope-home, |
37 | 84 | Provides: indicator-renderer | ||
38 | 85 | Recommends: unity-control-center, | 85 | Recommends: unity-control-center, |
39 | 86 | ${unity-default-masterscopes} | 86 | ${unity-default-masterscopes} |
40 | 87 | nautilus, | 87 | nautilus, |
41 | 88 | gnome-disk-utility, | 88 | gnome-disk-utility, |
43 | 89 | indicator-appmenu (>= 15.02.0), | 89 | hud, |
44 | 90 | session-shortcuts, | ||
45 | 91 | Breaks: unity-lens-applications (<< 5.12.0-0ubuntu2), | ||
46 | 92 | unity-lens-files (<< 5.10.0-0ubuntu2), | ||
47 | 93 | unity-lens-music (<< 6.0.0), | ||
48 | 94 | unity-lens-video (<< 0.3.6-0ubuntu2), | ||
49 | 95 | Description: Interface designed for efficiency of space and interaction. | ||
50 | 96 | Unity is a desktop experience that sings. Designed by Canonical and the Ayatana | ||
51 | 97 | community, Unity is all about the combination of familiarity and the future. We | ||
52 | 98 | bring together visual design, analysis of user experience testing, modern | ||
53 | 99 | graphics technologies and a deep understanding of the free software landscape | ||
54 | 100 | to produce what we hope will be the lightest, most elegant and most delightful | ||
55 | 101 | way to use your PC. | ||
56 | 102 | |||
57 | 103 | Package: unity-services | ||
58 | 104 | Architecture: any | ||
59 | 105 | Depends: ${shlibs:Depends}, | ||
60 | 106 | ${misc:Depends}, | ||
61 | 107 | indicator-common, | ||
62 | 108 | Provides: indicator-renderer | ||
63 | 109 | Recommends: indicator-appmenu (>= 15.02.0), | ||
64 | 90 | indicator-application, | 110 | indicator-application, |
65 | 91 | indicator-sound, | 111 | indicator-sound, |
66 | 92 | indicator-bluetooth, | 112 | indicator-bluetooth, |
67 | @@ -96,24 +116,6 @@ | |||
68 | 96 | indicator-printers, | 116 | indicator-printers, |
69 | 97 | indicator-power, | 117 | indicator-power, |
70 | 98 | indicator-session, | 118 | indicator-session, |
71 | 99 | hud, | ||
72 | 100 | session-shortcuts, | ||
73 | 101 | Breaks: unity-lens-applications (<< 5.12.0-0ubuntu2), | ||
74 | 102 | unity-lens-files (<< 5.10.0-0ubuntu2), | ||
75 | 103 | unity-lens-music (<< 6.0.0), | ||
76 | 104 | unity-lens-video (<< 0.3.6-0ubuntu2), | ||
77 | 105 | Description: Interface designed for efficiency of space and interaction. | ||
78 | 106 | Unity is a desktop experience that sings. Designed by Canonical and the Ayatana | ||
79 | 107 | community, Unity is all about the combination of familiarity and the future. We | ||
80 | 108 | bring together visual design, analysis of user experience testing, modern | ||
81 | 109 | graphics technologies and a deep understanding of the free software landscape | ||
82 | 110 | to produce what we hope will be the lightest, most elegant and most delightful | ||
83 | 111 | way to use your PC. | ||
84 | 112 | |||
85 | 113 | Package: unity-services | ||
86 | 114 | Architecture: any | ||
87 | 115 | Depends: ${shlibs:Depends}, | ||
88 | 116 | ${misc:Depends}, | ||
89 | 117 | Description: Services for the Unity interface | 119 | Description: Services for the Unity interface |
90 | 118 | Unity is a desktop experience that sings. Designed by Canonical and the Ayatana | 120 | Unity is a desktop experience that sings. Designed by Canonical and the Ayatana |
91 | 119 | community, Unity is all about the combination of familiarity and the future. We | 121 | community, Unity is all about the combination of familiarity and the future. We |
92 | 120 | 122 | ||
93 | === modified file 'debian/libunity-core-6.0-9.install' | |||
94 | --- debian/libunity-core-6.0-9.install 2016-07-26 16:45:34 +0000 | |||
95 | +++ debian/libunity-core-6.0-9.install 2016-08-31 03:25:56 +0000 | |||
96 | @@ -2,8 +2,9 @@ | |||
97 | 2 | usr/lib/*/unity/*.py | 2 | usr/lib/*/unity/*.py |
98 | 3 | usr/share/ccsm | 3 | usr/share/ccsm |
99 | 4 | usr/share/gnome-control-center/ | 4 | usr/share/gnome-control-center/ |
102 | 5 | usr/share/unity | 5 | usr/share/unity/icons |
103 | 6 | usr/share/upstart/sessions/unity7.conf | 6 | usr/share/unity/themes |
104 | 7 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ | 7 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ |
105 | 8 | debian/source_unity.py usr/share/apport/package-hooks | 8 | debian/source_unity.py usr/share/apport/package-hooks |
106 | 9 | tools/convert-files/* usr/lib/compiz/migration/ | 9 | tools/convert-files/* usr/lib/compiz/migration/ |
107 | 10 | usr/share/upstart/sessions/unity7.conf | ||
108 | 10 | 11 | ||
109 | === modified file 'debian/unity-services.install' | |||
110 | --- debian/unity-services.install 2016-07-26 13:58:14 +0000 | |||
111 | +++ debian/unity-services.install 2016-08-31 03:25:56 +0000 | |||
112 | @@ -1,3 +1,6 @@ | |||
113 | 1 | usr/lib/*/unity/*service | 1 | usr/lib/*/unity/*service |
115 | 2 | usr/share/upstart/sessions/unity-panel-service*.conf | 2 | usr/share/upstart/sessions/unity-panel* |
116 | 3 | usr/share/upstart/systemd-session/upstart/unity-panel* | ||
117 | 4 | usr/lib/systemd/user/unity-panel* | ||
118 | 5 | usr/lib/systemd/user/unity-screen-locked.target | ||
119 | 3 | usr/share/man/*/unity-panel-service.1 | 6 | usr/share/man/*/unity-panel-service.1 |
120 | 4 | 7 | ||
121 | === added file 'debian/unity-services.links' | |||
122 | --- debian/unity-services.links 1970-01-01 00:00:00 +0000 | |||
123 | +++ debian/unity-services.links 2016-08-31 03:25:56 +0000 | |||
124 | @@ -0,0 +1,13 @@ | |||
125 | 1 | /usr/lib/systemd/user/indicator-application.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-application.service | ||
126 | 2 | /usr/lib/systemd/user/indicator-bluetooth.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-bluetooth.service | ||
127 | 3 | /usr/lib/systemd/user/indicator-datetime.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-datetime.service | ||
128 | 4 | /usr/lib/systemd/user/indicator-keyboard.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-keyboard.service | ||
129 | 5 | /usr/lib/systemd/user/indicator-messages.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-messages.service | ||
130 | 6 | /usr/lib/systemd/user/indicator-power.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-power.service | ||
131 | 7 | /usr/lib/systemd/user/indicator-session.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-session.service | ||
132 | 8 | /usr/lib/systemd/user/indicator-sound.service /usr/lib/systemd/user/unity-panel-service.service.wants/indicator-sound.service | ||
133 | 9 | /usr/lib/systemd/user/indicator-datetime.service /usr/lib/systemd/user/unity-panel-service-lockscreen.service.wants/indicator-datetime.service | ||
134 | 10 | /usr/lib/systemd/user/indicator-keyboard.service /usr/lib/systemd/user/unity-panel-service-lockscreen.service.wants/indicator-keyboard.service | ||
135 | 11 | /usr/lib/systemd/user/indicator-power.service /usr/lib/systemd/user/unity-panel-service-lockscreen.service.wants/indicator-power.service | ||
136 | 12 | /usr/lib/systemd/user/indicator-session.service /usr/lib/systemd/user/unity-panel-service-lockscreen.service.wants/indicator-session.service | ||
137 | 13 | /usr/lib/systemd/user/indicator-sound.service /usr/lib/systemd/user/unity-panel-service-lockscreen.service.wants/indicator-sound.service | ||
138 | 0 | 14 | ||
139 | === modified file 'debian/unity.install' | |||
140 | --- debian/unity.install 2016-07-26 16:45:34 +0000 | |||
141 | +++ debian/unity.install 2016-08-31 03:25:56 +0000 | |||
142 | @@ -2,6 +2,9 @@ | |||
143 | 2 | usr/bin | 2 | usr/bin |
144 | 3 | usr/lib/*/compiz/libunity*.so | 3 | usr/lib/*/compiz/libunity*.so |
145 | 4 | usr/lib/*/unity/unity-active-plugins-safety-check | 4 | usr/lib/*/unity/unity-active-plugins-safety-check |
146 | 5 | usr/lib/*/unity/unity-compiz-profile-select | ||
147 | 5 | usr/share/man/*/unity.1 | 6 | usr/share/man/*/unity.1 |
148 | 6 | usr/share/compiz | 7 | usr/share/compiz |
149 | 7 | usr/share/locale | 8 | usr/share/locale |
150 | 9 | usr/lib/systemd/user/unity7.service | ||
151 | 10 | usr/share/upstart/systemd-session/upstart/unity7.override | ||
152 | 8 | 11 | ||
153 | === modified file 'lockscreen/LockScreenController.cpp' | |||
154 | --- lockscreen/LockScreenController.cpp 2016-07-04 12:45:06 +0000 | |||
155 | +++ lockscreen/LockScreenController.cpp 2016-08-31 03:25:56 +0000 | |||
156 | @@ -56,6 +56,7 @@ | |||
157 | 56 | Controller::Controller(DBusManager::Ptr const& dbus_manager, | 56 | Controller::Controller(DBusManager::Ptr const& dbus_manager, |
158 | 57 | session::Manager::Ptr const& session_manager, | 57 | session::Manager::Ptr const& session_manager, |
159 | 58 | key::Grabber::Ptr const& key_grabber, | 58 | key::Grabber::Ptr const& key_grabber, |
160 | 59 | SystemdWrapper::Ptr const& systemd_wrapper, | ||
161 | 59 | UpstartWrapper::Ptr const& upstart_wrapper, | 60 | UpstartWrapper::Ptr const& upstart_wrapper, |
162 | 60 | ShieldFactoryInterface::Ptr const& shield_factory, | 61 | ShieldFactoryInterface::Ptr const& shield_factory, |
163 | 61 | bool test_mode) | 62 | bool test_mode) |
164 | @@ -63,6 +64,7 @@ | |||
165 | 63 | , dbus_manager_(dbus_manager) | 64 | , dbus_manager_(dbus_manager) |
166 | 64 | , session_manager_(session_manager) | 65 | , session_manager_(session_manager) |
167 | 65 | , key_grabber_(key_grabber) | 66 | , key_grabber_(key_grabber) |
168 | 67 | , systemd_wrapper_(systemd_wrapper) | ||
169 | 66 | , upstart_wrapper_(upstart_wrapper) | 68 | , upstart_wrapper_(upstart_wrapper) |
170 | 67 | , shield_factory_(shield_factory) | 69 | , shield_factory_(shield_factory) |
171 | 68 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) | 70 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) |
172 | @@ -129,6 +131,7 @@ | |||
173 | 129 | shields_.clear(); | 131 | shields_.clear(); |
174 | 130 | 132 | ||
175 | 131 | upstart_wrapper_->Emit("desktop-unlock"); | 133 | upstart_wrapper_->Emit("desktop-unlock"); |
176 | 134 | systemd_wrapper_->Stop("unity-screen-locked.target"); | ||
177 | 132 | accelerator_controller_.reset(); | 135 | accelerator_controller_.reset(); |
178 | 133 | indicators_.reset(); | 136 | indicators_.reset(); |
179 | 134 | } | 137 | } |
180 | @@ -464,6 +467,7 @@ | |||
181 | 464 | { | 467 | { |
182 | 465 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); | 468 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); |
183 | 466 | upstart_wrapper_->Emit("desktop-lock"); | 469 | upstart_wrapper_->Emit("desktop-lock"); |
184 | 470 | systemd_wrapper_->Stop("unity-screen-locked.target"); | ||
185 | 467 | 471 | ||
186 | 468 | accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_); | 472 | accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_); |
187 | 469 | auto activate_key = WindowManager::Default().activate_indicators_key(); | 473 | auto activate_key = WindowManager::Default().activate_indicators_key(); |
188 | 470 | 474 | ||
189 | === modified file 'lockscreen/LockScreenController.h' | |||
190 | --- lockscreen/LockScreenController.h 2016-06-21 01:28:26 +0000 | |||
191 | +++ lockscreen/LockScreenController.h 2016-08-31 03:25:56 +0000 | |||
192 | @@ -31,6 +31,7 @@ | |||
193 | 31 | #include "ScreenSaverDBusManager.h" | 31 | #include "ScreenSaverDBusManager.h" |
194 | 32 | #include "unity-shared/BackgroundEffectHelper.h" | 32 | #include "unity-shared/BackgroundEffectHelper.h" |
195 | 33 | #include "unity-shared/KeyGrabber.h" | 33 | #include "unity-shared/KeyGrabber.h" |
196 | 34 | #include "unity-shared/SystemdWrapper.h" | ||
197 | 34 | #include "unity-shared/UpstartWrapper.h" | 35 | #include "unity-shared/UpstartWrapper.h" |
198 | 35 | 36 | ||
199 | 36 | namespace unity | 37 | namespace unity |
200 | @@ -46,6 +47,7 @@ | |||
201 | 46 | typedef std::shared_ptr<Controller> Ptr; | 47 | typedef std::shared_ptr<Controller> Ptr; |
202 | 47 | 48 | ||
203 | 48 | Controller(DBusManager::Ptr const&, session::Manager::Ptr const&, key::Grabber::Ptr const&, | 49 | Controller(DBusManager::Ptr const&, session::Manager::Ptr const&, key::Grabber::Ptr const&, |
204 | 50 | SystemdWrapper::Ptr const& systemd_wrapper = std::make_shared<SystemdWrapper>(), | ||
205 | 49 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), | 51 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), |
206 | 50 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), | 52 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), |
207 | 51 | bool test_mode = false); | 53 | bool test_mode = false); |
208 | @@ -88,6 +90,7 @@ | |||
209 | 88 | key::Grabber::Ptr key_grabber_; | 90 | key::Grabber::Ptr key_grabber_; |
210 | 89 | indicator::Indicators::Ptr indicators_; | 91 | indicator::Indicators::Ptr indicators_; |
211 | 90 | AcceleratorController::Ptr accelerator_controller_; | 92 | AcceleratorController::Ptr accelerator_controller_; |
212 | 93 | SystemdWrapper::Ptr systemd_wrapper_; | ||
213 | 91 | UpstartWrapper::Ptr upstart_wrapper_; | 94 | UpstartWrapper::Ptr upstart_wrapper_; |
214 | 92 | ShieldFactoryInterface::Ptr shield_factory_; | 95 | ShieldFactoryInterface::Ptr shield_factory_; |
215 | 93 | SuspendInhibitorManager::Ptr suspend_inhibitor_manager_; | 96 | SuspendInhibitorManager::Ptr suspend_inhibitor_manager_; |
216 | 94 | 97 | ||
217 | === modified file 'services/CMakeLists.txt' | |||
218 | --- services/CMakeLists.txt 2016-02-09 01:26:22 +0000 | |||
219 | +++ services/CMakeLists.txt 2016-08-31 03:25:56 +0000 | |||
220 | @@ -58,3 +58,34 @@ | |||
221 | 58 | 58 | ||
222 | 59 | configure_file(unity-panel-service-lockscreen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.conf) | 59 | configure_file(unity-panel-service-lockscreen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.conf) |
223 | 60 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) | 60 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) |
224 | 61 | |||
225 | 62 | ## | ||
226 | 63 | ## Systemd Unit Files | ||
227 | 64 | ## | ||
228 | 65 | |||
229 | 66 | # where to install | ||
230 | 67 | # Uncomment when we drop Vivid | ||
231 | 68 | # pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) | ||
232 | 69 | set (SYSTEMD_USER_DIR "/usr/lib/systemd/user") | ||
233 | 70 | message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") | ||
234 | 71 | |||
235 | 72 | configure_file (unity-panel-service.service.in "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service.service") | ||
236 | 73 | configure_file (unity-panel-service-lockscreen.service.in "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.service") | ||
237 | 74 | |||
238 | 75 | install( FILES | ||
239 | 76 | "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service.service" | ||
240 | 77 | "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.service" | ||
241 | 78 | "${CMAKE_CURRENT_SOURCE_DIR}/unity-screen-locked.target" | ||
242 | 79 | DESTINATION "${SYSTEMD_USER_DIR}") | ||
243 | 80 | |||
244 | 81 | ## | ||
245 | 82 | ## Upstart systemd override Job File | ||
246 | 83 | ## | ||
247 | 84 | |||
248 | 85 | set (UPSTART_SYSTEMD_OVERRIDE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/upstart/systemd-session/upstart") | ||
249 | 86 | message (STATUS "${UPSTART_SYSTEMD_OVERRIDE_DIR} is the Upstart override Job File for systemd dir") | ||
250 | 87 | |||
251 | 88 | install (FILES | ||
252 | 89 | unity-panel-service.override | ||
253 | 90 | unity-panel-service-lockscreen.override | ||
254 | 91 | DESTINATION "${UPSTART_SYSTEMD_OVERRIDE_DIR}") | ||
255 | 61 | 92 | ||
256 | === added file 'services/unity-panel-service-lockscreen.override' | |||
257 | --- services/unity-panel-service-lockscreen.override 1970-01-01 00:00:00 +0000 | |||
258 | +++ services/unity-panel-service-lockscreen.override 2016-08-31 03:25:56 +0000 | |||
259 | @@ -0,0 +1,1 @@ | |||
260 | 1 | manual | ||
261 | 0 | 2 | ||
262 | === added file 'services/unity-panel-service-lockscreen.service.in' | |||
263 | --- services/unity-panel-service-lockscreen.service.in 1970-01-01 00:00:00 +0000 | |||
264 | +++ services/unity-panel-service-lockscreen.service.in 2016-08-31 03:25:56 +0000 | |||
265 | @@ -0,0 +1,7 @@ | |||
266 | 1 | [Unit] | ||
267 | 2 | Description=Backing Service for the Unity Panel in Lockscreen mode | ||
268 | 3 | PartOf=unity-screen-locked.target | ||
269 | 4 | |||
270 | 5 | [Service] | ||
271 | 6 | ExecStart=${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-panel-service --lockscreen-mode | ||
272 | 7 | Restart=on-failure | ||
273 | 0 | 8 | ||
274 | === added file 'services/unity-panel-service.override' | |||
275 | --- services/unity-panel-service.override 1970-01-01 00:00:00 +0000 | |||
276 | +++ services/unity-panel-service.override 2016-08-31 03:25:56 +0000 | |||
277 | @@ -0,0 +1,1 @@ | |||
278 | 1 | manual | ||
279 | 0 | 2 | ||
280 | === added file 'services/unity-panel-service.service.in' | |||
281 | --- services/unity-panel-service.service.in 1970-01-01 00:00:00 +0000 | |||
282 | +++ services/unity-panel-service.service.in 2016-08-31 03:25:56 +0000 | |||
283 | @@ -0,0 +1,9 @@ | |||
284 | 1 | [Unit] | ||
285 | 2 | Description=Backing Service for the Unity Panel | ||
286 | 3 | After=unity7.service | ||
287 | 4 | PartOf=graphical-session.target | ||
288 | 5 | BindsTo=indicators-pre.target | ||
289 | 6 | |||
290 | 7 | [Service] | ||
291 | 8 | ExecStart=${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-panel-service | ||
292 | 9 | Restart=on-failure | ||
293 | 0 | 10 | ||
294 | === added file 'services/unity-screen-locked.target' | |||
295 | --- services/unity-screen-locked.target 1970-01-01 00:00:00 +0000 | |||
296 | +++ services/unity-screen-locked.target 2016-08-31 03:25:56 +0000 | |||
297 | @@ -0,0 +1,4 @@ | |||
298 | 1 | [Unit] | ||
299 | 2 | Description=A target that, when running, represents the screen being locked | ||
300 | 3 | Wants=ubuntu-panel-service-lock.service | ||
301 | 4 | PartOf=graphical-session.target | ||
302 | 0 | 5 | ||
303 | === modified file 'tests/CMakeLists.txt' | |||
304 | --- tests/CMakeLists.txt 2015-12-17 22:32:37 +0000 | |||
305 | +++ tests/CMakeLists.txt 2016-08-31 03:25:56 +0000 | |||
306 | @@ -286,6 +286,7 @@ | |||
307 | 286 | test_switcher_controller_class.cpp | 286 | test_switcher_controller_class.cpp |
308 | 287 | test_switcher_model.cpp | 287 | test_switcher_model.cpp |
309 | 288 | test_switcher_view.cpp | 288 | test_switcher_view.cpp |
310 | 289 | test_systemd_wrapper.cpp | ||
311 | 289 | test_tabiterator.cpp | 290 | test_tabiterator.cpp |
312 | 290 | test_texture_cache.cpp | 291 | test_texture_cache.cpp |
313 | 291 | test_text_input.cpp | 292 | test_text_input.cpp |
314 | 292 | 293 | ||
315 | === modified file 'tests/test_lockscreen_controller.cpp' | |||
316 | --- tests/test_lockscreen_controller.cpp 2016-06-21 14:40:26 +0000 | |||
317 | +++ tests/test_lockscreen_controller.cpp 2016-08-31 03:25:56 +0000 | |||
318 | @@ -83,9 +83,10 @@ | |||
319 | 83 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) | 83 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) |
320 | 84 | , key_grabber(std::make_shared<key::MockGrabber::Nice>()) | 84 | , key_grabber(std::make_shared<key::MockGrabber::Nice>()) |
321 | 85 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) | 85 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) |
322 | 86 | , systemd_wrapper(std::make_shared<SystemdWrapper>()) | ||
323 | 86 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) | 87 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) |
324 | 87 | , shield_factory(std::make_shared<ShieldFactoryMock>()) | 88 | , shield_factory(std::make_shared<ShieldFactoryMock>()) |
326 | 88 | , controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory) | 89 | , controller(dbus_manager, session_manager, key_grabber, systemd_wrapper, upstart_wrapper, shield_factory) |
327 | 89 | {} | 90 | {} |
328 | 90 | 91 | ||
329 | 91 | struct ControllerWrap : Controller | 92 | struct ControllerWrap : Controller |
330 | @@ -93,9 +94,10 @@ | |||
331 | 93 | ControllerWrap(DBusManager::Ptr const& dbus_manager, | 94 | ControllerWrap(DBusManager::Ptr const& dbus_manager, |
332 | 94 | session::Manager::Ptr const& session_manager, | 95 | session::Manager::Ptr const& session_manager, |
333 | 95 | key::Grabber::Ptr const& key_grabber, | 96 | key::Grabber::Ptr const& key_grabber, |
334 | 97 | SystemdWrapper::Ptr const& systemd_wrapper, | ||
335 | 96 | UpstartWrapper::Ptr const& upstart_wrapper, | 98 | UpstartWrapper::Ptr const& upstart_wrapper, |
336 | 97 | ShieldFactoryInterface::Ptr const& shield_factory) | 99 | ShieldFactoryInterface::Ptr const& shield_factory) |
338 | 98 | : Controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory, /* test_mode */ true) | 100 | : Controller(dbus_manager, session_manager, key_grabber, systemd_wrapper, upstart_wrapper, shield_factory, /* test_mode */ true) |
339 | 99 | {} | 101 | {} |
340 | 100 | 102 | ||
341 | 101 | using Controller::shields_; | 103 | using Controller::shields_; |
342 | @@ -112,6 +114,7 @@ | |||
343 | 112 | session::MockManager::Ptr session_manager; | 114 | session::MockManager::Ptr session_manager; |
344 | 113 | key::MockGrabber::Ptr key_grabber; | 115 | key::MockGrabber::Ptr key_grabber; |
345 | 114 | DBusManager::Ptr dbus_manager; | 116 | DBusManager::Ptr dbus_manager; |
346 | 117 | unity::SystemdWrapper::Ptr systemd_wrapper; | ||
347 | 115 | unity::UpstartWrapper::Ptr upstart_wrapper; | 118 | unity::UpstartWrapper::Ptr upstart_wrapper; |
348 | 116 | 119 | ||
349 | 117 | ShieldFactoryMock::Ptr shield_factory; | 120 | ShieldFactoryMock::Ptr shield_factory; |
350 | 118 | 121 | ||
351 | === added file 'tests/test_systemd_wrapper.cpp' | |||
352 | --- tests/test_systemd_wrapper.cpp 1970-01-01 00:00:00 +0000 | |||
353 | +++ tests/test_systemd_wrapper.cpp 2016-08-31 03:25:56 +0000 | |||
354 | @@ -0,0 +1,111 @@ | |||
355 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
356 | 2 | /* | ||
357 | 3 | * Copyright (c) 2016 Canonical Ltd | ||
358 | 4 | * | ||
359 | 5 | * This program is free software: you can redistribute it and/or modify | ||
360 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
361 | 7 | * published by the Free Software Foundation. | ||
362 | 8 | * | ||
363 | 9 | * This program is distributed in the hope that it will be useful, | ||
364 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
365 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
366 | 12 | * GNU General Public License for more details. | ||
367 | 13 | * | ||
368 | 14 | * You should have received a copy of the GNU General Public License | ||
369 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
370 | 16 | * | ||
371 | 17 | * Authored by: Ted Gould <ted@canonical.com> | ||
372 | 18 | */ | ||
373 | 19 | |||
374 | 20 | #include <gtest/gtest.h> | ||
375 | 21 | using namespace testing; | ||
376 | 22 | |||
377 | 23 | #include "unity-shared/SystemdWrapper.h" | ||
378 | 24 | |||
379 | 25 | #include <UnityCore/GLibDBusServer.h> | ||
380 | 26 | #include <UnityCore/Variant.h> | ||
381 | 27 | |||
382 | 28 | #include "test_utils.h" | ||
383 | 29 | |||
384 | 30 | namespace | ||
385 | 31 | { | ||
386 | 32 | |||
387 | 33 | const std::string SYSTEMD = | ||
388 | 34 | R"(<node> | ||
389 | 35 | <interface name="org.freedesktop.systemd1.Manager"> | ||
390 | 36 | <method name="StartUnit"> | ||
391 | 37 | <arg name="name" type="s" direction="in" /> | ||
392 | 38 | <arg name="mode" type="s" direction="in" /> | ||
393 | 39 | <arg name="job" type="o" direction="out" /> | ||
394 | 40 | </method> | ||
395 | 41 | <method name="StopUnit"> | ||
396 | 42 | <arg name="name" type="s" direction="in" /> | ||
397 | 43 | <arg name="mode" type="s" direction="in" /> | ||
398 | 44 | <arg name="job" type="o" direction="out" /> | ||
399 | 45 | </method> | ||
400 | 46 | </interface> | ||
401 | 47 | </node>)"; | ||
402 | 48 | |||
403 | 49 | struct MockSystemdWrapper : unity::SystemdWrapper { | ||
404 | 50 | MockSystemdWrapper() | ||
405 | 51 | : SystemdWrapper(SystemdWrapper::TestMode()) | ||
406 | 52 | {} | ||
407 | 53 | }; | ||
408 | 54 | |||
409 | 55 | struct TestSystemdWrapper : public Test | ||
410 | 56 | { | ||
411 | 57 | TestSystemdWrapper() | ||
412 | 58 | { | ||
413 | 59 | systemd_server_ = std::make_shared<unity::glib::DBusServer>("com.canonical.Unity.Test.Systemd"); | ||
414 | 60 | systemd_server_->AddObjects(SYSTEMD, "/org/freedesktop/systemd1"); | ||
415 | 61 | |||
416 | 62 | Utils::WaitUntilMSec([this] { return systemd_server_->IsConnected(); }); | ||
417 | 63 | Utils::WaitUntilMSec([this] { return systemd_wrapper_.IsConnected(); }); | ||
418 | 64 | } | ||
419 | 65 | |||
420 | 66 | unity::glib::DBusServer::Ptr systemd_server_; | ||
421 | 67 | MockSystemdWrapper systemd_wrapper_; | ||
422 | 68 | }; | ||
423 | 69 | |||
424 | 70 | |||
425 | 71 | TEST_F(TestSystemdWrapper, Start) | ||
426 | 72 | { | ||
427 | 73 | bool start_sent = false; | ||
428 | 74 | |||
429 | 75 | systemd_server_->GetObjects().front()->SetMethodsCallsHandler([&] (std::string const& method, GVariant* par) -> GVariant* { | ||
430 | 76 | if (method == "StartUnit") | ||
431 | 77 | { | ||
432 | 78 | start_sent = true; | ||
433 | 79 | |||
434 | 80 | std::string event_name = glib::Variant(g_variant_get_child_value(par, 0)).GetString(); | ||
435 | 81 | EXPECT_EQ("unity-screen-locked", event_name); | ||
436 | 82 | } | ||
437 | 83 | |||
438 | 84 | return nullptr; | ||
439 | 85 | }); | ||
440 | 86 | |||
441 | 87 | systemd_wrapper_.Start("unity-screen-locked"); | ||
442 | 88 | Utils::WaitUntil(start_sent); | ||
443 | 89 | } | ||
444 | 90 | |||
445 | 91 | TEST_F(TestSystemdWrapper, Stop) | ||
446 | 92 | { | ||
447 | 93 | bool stop_sent = false; | ||
448 | 94 | |||
449 | 95 | systemd_server_->GetObjects().front()->SetMethodsCallsHandler([&] (std::string const& method, GVariant* par) -> GVariant* { | ||
450 | 96 | if (method == "StopUnit") | ||
451 | 97 | { | ||
452 | 98 | stop_sent = true; | ||
453 | 99 | |||
454 | 100 | std::string event_name = glib::Variant(g_variant_get_child_value(par, 0)).GetString(); | ||
455 | 101 | EXPECT_EQ("unity-screen-locked", event_name); | ||
456 | 102 | } | ||
457 | 103 | |||
458 | 104 | return nullptr; | ||
459 | 105 | }); | ||
460 | 106 | |||
461 | 107 | systemd_wrapper_.Stop("unity-screen-locked"); | ||
462 | 108 | Utils::WaitUntil(stop_sent); | ||
463 | 109 | } | ||
464 | 110 | |||
465 | 111 | } | ||
466 | 0 | 112 | ||
467 | === modified file 'tools/CMakeLists.txt' | |||
468 | --- tools/CMakeLists.txt 2016-07-18 17:26:01 +0000 | |||
469 | +++ tools/CMakeLists.txt 2016-08-31 03:25:56 +0000 | |||
470 | @@ -28,3 +28,6 @@ | |||
471 | 28 | add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp) | 28 | add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp) |
472 | 29 | target_link_libraries(unity-active-plugins-safety-check ${LIBS}) | 29 | target_link_libraries(unity-active-plugins-safety-check ${LIBS}) |
473 | 30 | install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) | 30 | install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) |
474 | 31 | |||
475 | 32 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity-compiz-profile-select.in ${CMAKE_CURRENT_BINARY_DIR}/unity-compiz-profile-select @ONLY) | ||
476 | 33 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/unity-compiz-profile-select DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) | ||
477 | 31 | 34 | ||
478 | === added file 'tools/unity-compiz-profile-select.in' | |||
479 | --- tools/unity-compiz-profile-select.in 1970-01-01 00:00:00 +0000 | |||
480 | +++ tools/unity-compiz-profile-select.in 2016-08-31 03:25:56 +0000 | |||
481 | @@ -0,0 +1,25 @@ | |||
482 | 1 | #!/bin/bash | ||
483 | 2 | |||
484 | 3 | set -e | ||
485 | 4 | |||
486 | 5 | # If gnome-session is going to start compiz, | ||
487 | 6 | # we don't want to be the ones doing it. | ||
488 | 7 | |||
489 | 8 | if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then | ||
490 | 9 | echo "GNOME Session is starting Compiz" | ||
491 | 10 | stop ; exit 0 | ||
492 | 11 | fi | ||
493 | 12 | |||
494 | 13 | compiz_profile="ubuntu" | ||
495 | 14 | |||
496 | 15 | if ! /usr/lib/nux/unity_support_test -p; then | ||
497 | 16 | compiz_profile="ubuntu-lowgfx" | ||
498 | 17 | fi | ||
499 | 18 | |||
500 | 19 | echo "Using compiz profile '$compiz_profile'" | ||
501 | 20 | |||
502 | 21 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
503 | 22 | systemctl set-environment --user COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
504 | 23 | |||
505 | 24 | export COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
506 | 25 | exec @CMAKE_INSTALL_FULL_LIBDIR@/unity/unity-active-plugins-safety-check | ||
507 | 0 | 26 | ||
508 | === modified file 'unity-shared/CMakeLists.txt' | |||
509 | --- unity-shared/CMakeLists.txt 2016-08-12 11:21:48 +0000 | |||
510 | +++ unity-shared/CMakeLists.txt 2016-08-31 03:25:56 +0000 | |||
511 | @@ -60,6 +60,7 @@ | |||
512 | 60 | SpreadFilter.cpp | 60 | SpreadFilter.cpp |
513 | 61 | SpreadWidgets.cpp | 61 | SpreadWidgets.cpp |
514 | 62 | StaticCairoText.cpp | 62 | StaticCairoText.cpp |
515 | 63 | SystemdWrapper.cpp | ||
516 | 63 | TextureCache.cpp | 64 | TextureCache.cpp |
517 | 64 | TextInput.cpp | 65 | TextInput.cpp |
518 | 65 | TextureThumbnailProvider.cpp | 66 | TextureThumbnailProvider.cpp |
519 | 66 | 67 | ||
520 | === added file 'unity-shared/SystemdWrapper.cpp' | |||
521 | --- unity-shared/SystemdWrapper.cpp 1970-01-01 00:00:00 +0000 | |||
522 | +++ unity-shared/SystemdWrapper.cpp 2016-08-31 03:25:56 +0000 | |||
523 | @@ -0,0 +1,103 @@ | |||
524 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 3 -*- | ||
525 | 2 | /* | ||
526 | 3 | * Copyright © 2016 Canonical Ltd | ||
527 | 4 | * | ||
528 | 5 | * This program is free software: you can redistribute it and/or modify | ||
529 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
530 | 7 | * published by the Free Software Foundation. | ||
531 | 8 | * | ||
532 | 9 | * This program is distributed in the hope that it will be useful, | ||
533 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
534 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
535 | 12 | * GNU General Public License for more details. | ||
536 | 13 | * | ||
537 | 14 | * You should have received a copy of the GNU General Public License | ||
538 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
539 | 16 | * | ||
540 | 17 | * Authored by: Ted Gould <ted@canonical.com> | ||
541 | 18 | */ | ||
542 | 19 | |||
543 | 20 | #include "SystemdWrapper.h" | ||
544 | 21 | |||
545 | 22 | #include <UnityCore/GLibDBusProxy.h> | ||
546 | 23 | |||
547 | 24 | namespace unity | ||
548 | 25 | { | ||
549 | 26 | |||
550 | 27 | // | ||
551 | 28 | // Start private implementation | ||
552 | 29 | // | ||
553 | 30 | |||
554 | 31 | class SystemdWrapper::Impl | ||
555 | 32 | { | ||
556 | 33 | public: | ||
557 | 34 | Impl(bool test); | ||
558 | 35 | |||
559 | 36 | void Start(std::string const& name); | ||
560 | 37 | void Stop(std::string const& name); | ||
561 | 38 | bool IsConnected(); | ||
562 | 39 | |||
563 | 40 | private: | ||
564 | 41 | glib::DBusProxy::Ptr systemd_proxy_; | ||
565 | 42 | }; | ||
566 | 43 | |||
567 | 44 | SystemdWrapper::Impl::Impl(bool test) | ||
568 | 45 | { | ||
569 | 46 | std::string busname = "org.freedesktop.systemd1"; | ||
570 | 47 | if (test) { | ||
571 | 48 | busname = "com.canonical.Unity.Test.Systemd"; | ||
572 | 49 | } | ||
573 | 50 | |||
574 | 51 | systemd_proxy_ = std::make_shared<unity::glib::DBusProxy>(busname, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager"); | ||
575 | 52 | } | ||
576 | 53 | |||
577 | 54 | void SystemdWrapper::Impl::Start(std::string const& name) | ||
578 | 55 | { | ||
579 | 56 | if (IsConnected()) { | ||
580 | 57 | systemd_proxy_->Call("StartUnit", g_variant_new("(ss)", name.c_str(), "replace")); | ||
581 | 58 | } | ||
582 | 59 | } | ||
583 | 60 | |||
584 | 61 | void SystemdWrapper::Impl::Stop(std::string const& name) | ||
585 | 62 | { | ||
586 | 63 | if (IsConnected()) { | ||
587 | 64 | systemd_proxy_->Call("StopUnit", g_variant_new("(ss)", name.c_str(), "replace")); | ||
588 | 65 | } | ||
589 | 66 | } | ||
590 | 67 | |||
591 | 68 | bool SystemdWrapper::Impl::IsConnected() | ||
592 | 69 | { | ||
593 | 70 | return systemd_proxy_->IsConnected(); | ||
594 | 71 | } | ||
595 | 72 | |||
596 | 73 | // | ||
597 | 74 | // End private implementation | ||
598 | 75 | // | ||
599 | 76 | |||
600 | 77 | SystemdWrapper::SystemdWrapper() | ||
601 | 78 | : pimpl_(new Impl(false)) | ||
602 | 79 | {} | ||
603 | 80 | |||
604 | 81 | SystemdWrapper::SystemdWrapper(SystemdWrapper::TestMode const& tm) | ||
605 | 82 | : pimpl_(new Impl(true)) | ||
606 | 83 | {} | ||
607 | 84 | |||
608 | 85 | SystemdWrapper::~SystemdWrapper() | ||
609 | 86 | {} | ||
610 | 87 | |||
611 | 88 | void SystemdWrapper::Start(std::string const& name) | ||
612 | 89 | { | ||
613 | 90 | pimpl_->Start(name); | ||
614 | 91 | } | ||
615 | 92 | |||
616 | 93 | void SystemdWrapper::Stop(std::string const& name) | ||
617 | 94 | { | ||
618 | 95 | pimpl_->Stop(name); | ||
619 | 96 | } | ||
620 | 97 | |||
621 | 98 | bool SystemdWrapper::IsConnected() | ||
622 | 99 | { | ||
623 | 100 | return pimpl_->IsConnected(); | ||
624 | 101 | } | ||
625 | 102 | |||
626 | 103 | } | ||
627 | 0 | 104 | ||
628 | === added file 'unity-shared/SystemdWrapper.h' | |||
629 | --- unity-shared/SystemdWrapper.h 1970-01-01 00:00:00 +0000 | |||
630 | +++ unity-shared/SystemdWrapper.h 2016-08-31 03:25:56 +0000 | |||
631 | @@ -0,0 +1,55 @@ | |||
632 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
633 | 2 | /* | ||
634 | 3 | * Copyright © 2016 Canonical Ltd | ||
635 | 4 | * | ||
636 | 5 | * This program is free software: you can redistribute it and/or modify | ||
637 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
638 | 7 | * published by the Free Software Foundation. | ||
639 | 8 | * | ||
640 | 9 | * This program is distributed in the hope that it will be useful, | ||
641 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
642 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
643 | 12 | * GNU General Public License for more details. | ||
644 | 13 | * | ||
645 | 14 | * You should have received a copy of the GNU General Public License | ||
646 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
647 | 16 | * | ||
648 | 17 | * Authored by: Ted Gould <ted@canonical.com> | ||
649 | 18 | */ | ||
650 | 19 | |||
651 | 20 | #ifndef UNITY_SYSTEMD_WRAPPER | ||
652 | 21 | #define UNITY_SYSTEMD_WRAPPER | ||
653 | 22 | |||
654 | 23 | #include <memory> | ||
655 | 24 | |||
656 | 25 | namespace unity | ||
657 | 26 | { | ||
658 | 27 | |||
659 | 28 | class SystemdWrapper | ||
660 | 29 | { | ||
661 | 30 | public: | ||
662 | 31 | typedef std::shared_ptr<SystemdWrapper> Ptr; | ||
663 | 32 | |||
664 | 33 | SystemdWrapper(); | ||
665 | 34 | ~SystemdWrapper(); | ||
666 | 35 | |||
667 | 36 | void Start(std::string const& name); | ||
668 | 37 | void Stop(std::string const& name); | ||
669 | 38 | bool IsConnected(); | ||
670 | 39 | |||
671 | 40 | protected: | ||
672 | 41 | struct TestMode {}; | ||
673 | 42 | SystemdWrapper(TestMode const&); | ||
674 | 43 | |||
675 | 44 | private: | ||
676 | 45 | // Noncopyable | ||
677 | 46 | SystemdWrapper(SystemdWrapper const&) = delete; | ||
678 | 47 | SystemdWrapper& operator=(SystemdWrapper const&) = delete; | ||
679 | 48 | |||
680 | 49 | class Impl; | ||
681 | 50 | std::unique_ptr<Impl> pimpl_; | ||
682 | 51 | }; | ||
683 | 52 | |||
684 | 53 | } | ||
685 | 54 | |||
686 | 55 | #endif | ||
687 | 0 | 56 | ||
688 | === modified file 'unity7.conf.in' | |||
689 | --- unity7.conf.in 2016-07-21 13:01:59 +0000 | |||
690 | +++ unity7.conf.in 2016-08-31 03:25:56 +0000 | |||
691 | @@ -4,27 +4,7 @@ | |||
692 | 4 | start on xsession SESSION=ubuntu and started unity-settings-daemon | 4 | start on xsession SESSION=ubuntu and started unity-settings-daemon |
693 | 5 | stop on desktop-end | 5 | stop on desktop-end |
694 | 6 | 6 | ||
716 | 7 | pre-start script | 7 | pre-start exec @CMAKE_INSTALL_FULL_LIBDIR@/unity-compiz-profile-select |
696 | 8 | # If gnome-session is going to start compiz, | ||
697 | 9 | # we don't want to be the ones doing it. | ||
698 | 10 | |||
699 | 11 | if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then | ||
700 | 12 | echo "GNOME Session is starting Compiz" | ||
701 | 13 | stop ; exit 0 | ||
702 | 14 | fi | ||
703 | 15 | |||
704 | 16 | compiz_profile="ubuntu" | ||
705 | 17 | |||
706 | 18 | if ! /usr/lib/nux/unity_support_test -p; then | ||
707 | 19 | compiz_profile="ubuntu-lowgfx" | ||
708 | 20 | fi | ||
709 | 21 | |||
710 | 22 | echo "Using compiz profile '$compiz_profile'" | ||
711 | 23 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
712 | 24 | export COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
713 | 25 | |||
714 | 26 | ${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-active-plugins-safety-check | ||
715 | 27 | end script | ||
717 | 28 | 8 | ||
718 | 29 | respawn | 9 | respawn |
719 | 30 | exec compiz | 10 | exec compiz |
720 | 31 | 11 | ||
721 | === added file 'unity7.override' | |||
722 | --- unity7.override 1970-01-01 00:00:00 +0000 | |||
723 | +++ unity7.override 2016-08-31 03:25:56 +0000 | |||
724 | @@ -0,0 +1,1 @@ | |||
725 | 1 | manual | ||
726 | 0 | 2 | ||
727 | === added file 'unity7.service.in' | |||
728 | --- unity7.service.in 1970-01-01 00:00:00 +0000 | |||
729 | +++ unity7.service.in 2016-08-31 03:25:56 +0000 | |||
730 | @@ -0,0 +1,11 @@ | |||
731 | 1 | [Unit] | ||
732 | 2 | Description=Unity Shell v7 | ||
733 | 3 | Requires=unity-settings-daemon.service unity-panel-service.service bamfdaemon.service | ||
734 | 4 | Wants=unity-gtk-module.service | ||
735 | 5 | After=unity-settings-daemon.service | ||
736 | 6 | PartOf=graphical-session.target | ||
737 | 7 | |||
738 | 8 | [Service] | ||
739 | 9 | ExecStart=/usr/bin/compiz | ||
740 | 10 | ExecStartPre=@CMAKE_INSTALL_FULL_LIBDIR@/unity-compiz-profile-select | ||
741 | 11 | Restart=on-failure |
There have been changes recently to upstart job to change COMPIZ_ CONFIG_ PROFILE depending on the gfx environment. So please sync with upstream changes on that.
Also, please rebase on lp:~azzar1/unity/unity-active-plugins--safety-check, which will need to be ported too