Merge lp:~ted/unity/systemd-unit. into lp:unity
- systemd-unit.
- Merge into trunk
Proposed by
Ted Gould
Status: | Superseded |
---|---|
Proposed branch: | lp:~ted/unity/systemd-unit. |
Merge into: | lp:unity |
Diff against target: |
604 lines (+360/-20) 22 files modified
debian/control (+2/-0) debian/libunity-core-6.0-9.install (+2/-0) debian/unity-services.install (+1/-0) debian/unity7.conf (+1/-18) debian/unity7.override (+1/-0) debian/unity7.service (+11/-0) lockscreen/LockScreenController.cpp (+4/-0) lockscreen/LockScreenController.h (+3/-0) plugins/unityshell/unityshell.xml.in (+2/-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/test_lockscreen_controller.cpp (+5/-2) tools/CMakeLists.txt (+24/-0) tools/unity-compiz-profile (+25/-0) tools/unity_active_plugins_safety_check.cpp (+83/-0) unity-shared/CMakeLists.txt (+1/-0) unity-shared/SystemdWrapper.cpp (+88/-0) unity-shared/SystemdWrapper.h (+54/-0) |
To merge this branch: | bzr merge lp:~ted/unity/systemd-unit. |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+300584@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-07-20.
Commit message
Adding systemd user session units
Description of the change
To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2016-03-21 15:38:17 +0000 | |||
3 | +++ debian/control 2016-07-20 15:08:18 +0000 | |||
4 | @@ -52,6 +52,7 @@ | |||
5 | 52 | python3 (>= 3.4), | 52 | python3 (>= 3.4), |
6 | 53 | python-setuptools, | 53 | python-setuptools, |
7 | 54 | quilt, | 54 | quilt, |
8 | 55 | systemd, | ||
9 | 55 | xserver-xorg-video-dummy, | 56 | xserver-xorg-video-dummy, |
10 | 56 | xsltproc, | 57 | xsltproc, |
11 | 57 | Standards-Version: 3.9.5 | 58 | Standards-Version: 3.9.5 |
12 | @@ -127,6 +128,7 @@ | |||
13 | 127 | Architecture: all | 128 | Architecture: all |
14 | 128 | Multi-Arch: foreign | 129 | Multi-Arch: foreign |
15 | 129 | Depends: ${misc:Depends}, | 130 | Depends: ${misc:Depends}, |
16 | 131 | indicator-common, | ||
17 | 130 | Replaces: libunity-core-6.0-9 (<< 7.3.0), | 132 | Replaces: libunity-core-6.0-9 (<< 7.3.0), |
18 | 131 | Breaks: libunity-core-6.0-9 (<< 7.3.0), | 133 | Breaks: libunity-core-6.0-9 (<< 7.3.0), |
19 | 132 | Description: Interface designed for efficiency of space and interaction. | 134 | Description: Interface designed for efficiency of space and interaction. |
20 | 133 | 135 | ||
21 | === modified file 'debian/libunity-core-6.0-9.install' | |||
22 | --- debian/libunity-core-6.0-9.install 2016-02-09 01:26:22 +0000 | |||
23 | +++ debian/libunity-core-6.0-9.install 2016-07-20 15:08:18 +0000 | |||
24 | @@ -6,4 +6,6 @@ | |||
25 | 6 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ | 6 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ |
26 | 7 | debian/source_unity.py usr/share/apport/package-hooks | 7 | debian/source_unity.py usr/share/apport/package-hooks |
27 | 8 | debian/unity7.conf usr/share/upstart/sessions | 8 | debian/unity7.conf usr/share/upstart/sessions |
28 | 9 | debian/unity7.service usr/lib/systemd/user | ||
29 | 10 | debian/unity7.override usr/share/upstart/systemd-session/upstart | ||
30 | 9 | tools/convert-files/* usr/lib/compiz/migration/ | 11 | tools/convert-files/* usr/lib/compiz/migration/ |
31 | 10 | 12 | ||
32 | === modified file 'debian/unity-services.install' | |||
33 | --- debian/unity-services.install 2016-02-09 01:26:22 +0000 | |||
34 | +++ debian/unity-services.install 2016-07-20 15:08:18 +0000 | |||
35 | @@ -1,3 +1,4 @@ | |||
36 | 1 | usr/lib/*/unity/*service | 1 | usr/lib/*/unity/*service |
37 | 2 | usr/share/upstart | 2 | usr/share/upstart |
38 | 3 | usr/lib/systemd | ||
39 | 3 | usr/share/man/*/unity-panel-service.1 | 4 | usr/share/man/*/unity-panel-service.1 |
40 | 4 | 5 | ||
41 | === modified file 'debian/unity7.conf' | |||
42 | --- debian/unity7.conf 2016-07-05 01:26:04 +0000 | |||
43 | +++ debian/unity7.conf 2016-07-20 15:08:18 +0000 | |||
44 | @@ -4,24 +4,7 @@ | |||
45 | 4 | start on xsession SESSION=ubuntu and started unity-settings-daemon | 4 | start on xsession SESSION=ubuntu and started unity-settings-daemon |
46 | 5 | stop on desktop-end | 5 | stop on desktop-end |
47 | 6 | 6 | ||
66 | 7 | pre-start script | 7 | pre-start exec /usr/lib/unity/unity-compiz-profile |
49 | 8 | # If gnome-session is going to start compiz, | ||
50 | 9 | # we don't want to be the ones doing it. | ||
51 | 10 | |||
52 | 11 | if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then | ||
53 | 12 | echo "GNOME Session is starting Compiz" | ||
54 | 13 | stop ; exit 0 | ||
55 | 14 | fi | ||
56 | 15 | |||
57 | 16 | compiz_profile="ubuntu" | ||
58 | 17 | |||
59 | 18 | if ! /usr/lib/nux/unity_support_test -p; then | ||
60 | 19 | compiz_profile="ubuntu-lowgfx" | ||
61 | 20 | fi | ||
62 | 21 | |||
63 | 22 | echo "Using compiz profile '$compiz_profile'" | ||
64 | 23 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
65 | 24 | end script | ||
67 | 25 | 8 | ||
68 | 26 | respawn | 9 | respawn |
69 | 27 | exec compiz | 10 | exec compiz |
70 | 28 | 11 | ||
71 | === added file 'debian/unity7.override' | |||
72 | --- debian/unity7.override 1970-01-01 00:00:00 +0000 | |||
73 | +++ debian/unity7.override 2016-07-20 15:08:18 +0000 | |||
74 | @@ -0,0 +1,1 @@ | |||
75 | 1 | manual | ||
76 | 0 | 2 | ||
77 | === added file 'debian/unity7.service' | |||
78 | --- debian/unity7.service 1970-01-01 00:00:00 +0000 | |||
79 | +++ debian/unity7.service 2016-07-20 15:08:18 +0000 | |||
80 | @@ -0,0 +1,11 @@ | |||
81 | 1 | [Unit] | ||
82 | 2 | Description=Unity Shell v7 | ||
83 | 3 | Requires=unity-settings-daemon.service unity-panel-service.service bamfdaemon.service | ||
84 | 4 | Wants=unity-gtk-module.service | ||
85 | 5 | After=unity-settings-daemon.service | ||
86 | 6 | PartOf=graphical-session.target | ||
87 | 7 | |||
88 | 8 | [Service] | ||
89 | 9 | ExecStart=/usr/bin/compiz | ||
90 | 10 | ExecStart.Pre=/usr/lib/unity/unity-compiz-profile | ||
91 | 11 | Restart=on-failure | ||
92 | 0 | 12 | ||
93 | === modified file 'lockscreen/LockScreenController.cpp' | |||
94 | --- lockscreen/LockScreenController.cpp 2016-07-04 12:45:06 +0000 | |||
95 | +++ lockscreen/LockScreenController.cpp 2016-07-20 15:08:18 +0000 | |||
96 | @@ -56,6 +56,7 @@ | |||
97 | 56 | Controller::Controller(DBusManager::Ptr const& dbus_manager, | 56 | Controller::Controller(DBusManager::Ptr const& dbus_manager, |
98 | 57 | session::Manager::Ptr const& session_manager, | 57 | session::Manager::Ptr const& session_manager, |
99 | 58 | key::Grabber::Ptr const& key_grabber, | 58 | key::Grabber::Ptr const& key_grabber, |
100 | 59 | SystemdWrapper::Ptr const& systemd_wrapper, | ||
101 | 59 | UpstartWrapper::Ptr const& upstart_wrapper, | 60 | UpstartWrapper::Ptr const& upstart_wrapper, |
102 | 60 | ShieldFactoryInterface::Ptr const& shield_factory, | 61 | ShieldFactoryInterface::Ptr const& shield_factory, |
103 | 61 | bool test_mode) | 62 | bool test_mode) |
104 | @@ -63,6 +64,7 @@ | |||
105 | 63 | , dbus_manager_(dbus_manager) | 64 | , dbus_manager_(dbus_manager) |
106 | 64 | , session_manager_(session_manager) | 65 | , session_manager_(session_manager) |
107 | 65 | , key_grabber_(key_grabber) | 66 | , key_grabber_(key_grabber) |
108 | 67 | , systemd_wrapper_(systemd_wrapper) | ||
109 | 66 | , upstart_wrapper_(upstart_wrapper) | 68 | , upstart_wrapper_(upstart_wrapper) |
110 | 67 | , shield_factory_(shield_factory) | 69 | , shield_factory_(shield_factory) |
111 | 68 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) | 70 | , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>()) |
112 | @@ -129,6 +131,7 @@ | |||
113 | 129 | shields_.clear(); | 131 | shields_.clear(); |
114 | 130 | 132 | ||
115 | 131 | upstart_wrapper_->Emit("desktop-unlock"); | 133 | upstart_wrapper_->Emit("desktop-unlock"); |
116 | 134 | systemd_wrapper_->Stop("unity-screen-locked.target"); | ||
117 | 132 | accelerator_controller_.reset(); | 135 | accelerator_controller_.reset(); |
118 | 133 | indicators_.reset(); | 136 | indicators_.reset(); |
119 | 134 | } | 137 | } |
120 | @@ -464,6 +467,7 @@ | |||
121 | 464 | { | 467 | { |
122 | 465 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); | 468 | indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>(); |
123 | 466 | upstart_wrapper_->Emit("desktop-lock"); | 469 | upstart_wrapper_->Emit("desktop-lock"); |
124 | 470 | systemd_wrapper_->Stop("unity-screen-locked.target"); | ||
125 | 467 | 471 | ||
126 | 468 | accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_); | 472 | accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_); |
127 | 469 | auto activate_key = WindowManager::Default().activate_indicators_key(); | 473 | auto activate_key = WindowManager::Default().activate_indicators_key(); |
128 | 470 | 474 | ||
129 | === modified file 'lockscreen/LockScreenController.h' | |||
130 | --- lockscreen/LockScreenController.h 2016-06-21 01:28:26 +0000 | |||
131 | +++ lockscreen/LockScreenController.h 2016-07-20 15:08:18 +0000 | |||
132 | @@ -31,6 +31,7 @@ | |||
133 | 31 | #include "ScreenSaverDBusManager.h" | 31 | #include "ScreenSaverDBusManager.h" |
134 | 32 | #include "unity-shared/BackgroundEffectHelper.h" | 32 | #include "unity-shared/BackgroundEffectHelper.h" |
135 | 33 | #include "unity-shared/KeyGrabber.h" | 33 | #include "unity-shared/KeyGrabber.h" |
136 | 34 | #include "unity-shared/SystemdWrapper.h" | ||
137 | 34 | #include "unity-shared/UpstartWrapper.h" | 35 | #include "unity-shared/UpstartWrapper.h" |
138 | 35 | 36 | ||
139 | 36 | namespace unity | 37 | namespace unity |
140 | @@ -46,6 +47,7 @@ | |||
141 | 46 | typedef std::shared_ptr<Controller> Ptr; | 47 | typedef std::shared_ptr<Controller> Ptr; |
142 | 47 | 48 | ||
143 | 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&, |
144 | 50 | SystemdWrapper::Ptr const& systemd_wrapper = std::make_shared<SystemdWrapper>(), | ||
145 | 49 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), | 51 | UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared<UpstartWrapper>(), |
146 | 50 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), | 52 | ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared<ShieldFactory>(), |
147 | 51 | bool test_mode = false); | 53 | bool test_mode = false); |
148 | @@ -88,6 +90,7 @@ | |||
149 | 88 | key::Grabber::Ptr key_grabber_; | 90 | key::Grabber::Ptr key_grabber_; |
150 | 89 | indicator::Indicators::Ptr indicators_; | 91 | indicator::Indicators::Ptr indicators_; |
151 | 90 | AcceleratorController::Ptr accelerator_controller_; | 92 | AcceleratorController::Ptr accelerator_controller_; |
152 | 93 | SystemdWrapper::Ptr systemd_wrapper_; | ||
153 | 91 | UpstartWrapper::Ptr upstart_wrapper_; | 94 | UpstartWrapper::Ptr upstart_wrapper_; |
154 | 92 | ShieldFactoryInterface::Ptr shield_factory_; | 95 | ShieldFactoryInterface::Ptr shield_factory_; |
155 | 93 | SuspendInhibitorManager::Ptr suspend_inhibitor_manager_; | 96 | SuspendInhibitorManager::Ptr suspend_inhibitor_manager_; |
156 | 94 | 97 | ||
157 | === modified file 'plugins/unityshell/unityshell.xml.in' | |||
158 | --- plugins/unityshell/unityshell.xml.in 2016-04-05 13:23:27 +0000 | |||
159 | +++ plugins/unityshell/unityshell.xml.in 2016-07-20 15:08:18 +0000 | |||
160 | @@ -39,6 +39,8 @@ | |||
161 | 39 | <plugin>compiztoolbox</plugin> | 39 | <plugin>compiztoolbox</plugin> |
162 | 40 | <plugin>scale</plugin> | 40 | <plugin>scale</plugin> |
163 | 41 | <plugin>expo</plugin> | 41 | <plugin>expo</plugin> |
164 | 42 | <plugin>move</plugin> | ||
165 | 43 | <plugin>resize</plugin> | ||
166 | 42 | </requirement> | 44 | </requirement> |
167 | 43 | <conflict> | 45 | <conflict> |
168 | 44 | <plugin>decor</plugin> | 46 | <plugin>decor</plugin> |
169 | 45 | 47 | ||
170 | === modified file 'services/CMakeLists.txt' | |||
171 | --- services/CMakeLists.txt 2016-02-09 01:26:22 +0000 | |||
172 | +++ services/CMakeLists.txt 2016-07-20 15:08:18 +0000 | |||
173 | @@ -58,3 +58,34 @@ | |||
174 | 58 | 58 | ||
175 | 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) |
176 | 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) |
177 | 61 | |||
178 | 62 | ## | ||
179 | 63 | ## Systemd Unit Files | ||
180 | 64 | ## | ||
181 | 65 | |||
182 | 66 | # where to install | ||
183 | 67 | # Uncomment when we drop Vivid | ||
184 | 68 | # pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) | ||
185 | 69 | set (SYSTEMD_USER_DIR "/usr/lib/systemd/user") | ||
186 | 70 | message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") | ||
187 | 71 | |||
188 | 72 | configure_file (unity-panel-service.service.in "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service.service") | ||
189 | 73 | configure_file (unity-panel-service-lockscreen.service.in "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.service") | ||
190 | 74 | |||
191 | 75 | install( FILES | ||
192 | 76 | "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service.service" | ||
193 | 77 | "${CMAKE_CURRENT_BINARY_DIR}/unity-panel-service-lockscreen.service" | ||
194 | 78 | "${CMAKE_CURRENT_BINARY_DIR}/unity-screen-locked.target" | ||
195 | 79 | DESTINATION "${SYSTEMD_USER_DIR}") | ||
196 | 80 | |||
197 | 81 | ## | ||
198 | 82 | ## Upstart systemd override Job File | ||
199 | 83 | ## | ||
200 | 84 | |||
201 | 85 | set (UPSTART_SYSTEMD_OVERRIDE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/upstart/systemd-session/upstart") | ||
202 | 86 | message (STATUS "${UPSTART_SYSTEMD_OVERRIDE_DIR} is the Upstart override Job File for systemd dir") | ||
203 | 87 | |||
204 | 88 | install (FILES | ||
205 | 89 | unity-panel-service.override | ||
206 | 90 | unity-panel-service-lockscreen.override | ||
207 | 91 | DESTINATION "${UPSTART_SYSTEMD_OVERRIDE_DIR}") | ||
208 | 61 | 92 | ||
209 | === added file 'services/unity-panel-service-lockscreen.override' | |||
210 | --- services/unity-panel-service-lockscreen.override 1970-01-01 00:00:00 +0000 | |||
211 | +++ services/unity-panel-service-lockscreen.override 2016-07-20 15:08:18 +0000 | |||
212 | @@ -0,0 +1,1 @@ | |||
213 | 1 | manual | ||
214 | 0 | 2 | ||
215 | === added file 'services/unity-panel-service-lockscreen.service.in' | |||
216 | --- services/unity-panel-service-lockscreen.service.in 1970-01-01 00:00:00 +0000 | |||
217 | +++ services/unity-panel-service-lockscreen.service.in 2016-07-20 15:08:18 +0000 | |||
218 | @@ -0,0 +1,7 @@ | |||
219 | 1 | [Unit] | ||
220 | 2 | Description=Backing Service for the Unity Panel in Lockscreen mode | ||
221 | 3 | PartOf=unity-screen-locked.target | ||
222 | 4 | |||
223 | 5 | [Service] | ||
224 | 6 | ExecStart=${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-panel-service --lockscreen-mode | ||
225 | 7 | Restart=on-failure | ||
226 | 0 | 8 | ||
227 | === added file 'services/unity-panel-service.override' | |||
228 | --- services/unity-panel-service.override 1970-01-01 00:00:00 +0000 | |||
229 | +++ services/unity-panel-service.override 2016-07-20 15:08:18 +0000 | |||
230 | @@ -0,0 +1,1 @@ | |||
231 | 1 | manual | ||
232 | 0 | 2 | ||
233 | === added file 'services/unity-panel-service.service.in' | |||
234 | --- services/unity-panel-service.service.in 1970-01-01 00:00:00 +0000 | |||
235 | +++ services/unity-panel-service.service.in 2016-07-20 15:08:18 +0000 | |||
236 | @@ -0,0 +1,9 @@ | |||
237 | 1 | [Unit] | ||
238 | 2 | Description=Backing Service for the Unity Panel | ||
239 | 3 | After=unity7.service | ||
240 | 4 | PartOf=graphical-session.target | ||
241 | 5 | BindsTo=indicators-pre.target | ||
242 | 6 | |||
243 | 7 | [Service] | ||
244 | 8 | ExecStart=${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-panel-service | ||
245 | 9 | Restart=on-failure | ||
246 | 0 | 10 | ||
247 | === added file 'services/unity-screen-locked.target' | |||
248 | --- services/unity-screen-locked.target 1970-01-01 00:00:00 +0000 | |||
249 | +++ services/unity-screen-locked.target 2016-07-20 15:08:18 +0000 | |||
250 | @@ -0,0 +1,4 @@ | |||
251 | 1 | [Unit] | ||
252 | 2 | Description=A target that, when running, represents the screen being locked | ||
253 | 3 | Wants=ubuntu-panel-service-lock.service | ||
254 | 4 | PartOf=graphical-session.target | ||
255 | 0 | 5 | ||
256 | === modified file 'tests/test_lockscreen_controller.cpp' | |||
257 | --- tests/test_lockscreen_controller.cpp 2016-06-21 14:40:26 +0000 | |||
258 | +++ tests/test_lockscreen_controller.cpp 2016-07-20 15:08:18 +0000 | |||
259 | @@ -83,9 +83,10 @@ | |||
260 | 83 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) | 83 | , session_manager(std::make_shared<NiceMock<session::MockManager>>()) |
261 | 84 | , key_grabber(std::make_shared<key::MockGrabber::Nice>()) | 84 | , key_grabber(std::make_shared<key::MockGrabber::Nice>()) |
262 | 85 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) | 85 | , dbus_manager(std::make_shared<DBusManager>(session_manager)) |
263 | 86 | , systemd_wrapper(std::make_shared<SystemdWrapper>()) | ||
264 | 86 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) | 87 | , upstart_wrapper(std::make_shared<UpstartWrapper>()) |
265 | 87 | , shield_factory(std::make_shared<ShieldFactoryMock>()) | 88 | , shield_factory(std::make_shared<ShieldFactoryMock>()) |
267 | 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) |
268 | 89 | {} | 90 | {} |
269 | 90 | 91 | ||
270 | 91 | struct ControllerWrap : Controller | 92 | struct ControllerWrap : Controller |
271 | @@ -93,9 +94,10 @@ | |||
272 | 93 | ControllerWrap(DBusManager::Ptr const& dbus_manager, | 94 | ControllerWrap(DBusManager::Ptr const& dbus_manager, |
273 | 94 | session::Manager::Ptr const& session_manager, | 95 | session::Manager::Ptr const& session_manager, |
274 | 95 | key::Grabber::Ptr const& key_grabber, | 96 | key::Grabber::Ptr const& key_grabber, |
275 | 97 | SystemdWrapper::Ptr const& systemd_wrapper, | ||
276 | 96 | UpstartWrapper::Ptr const& upstart_wrapper, | 98 | UpstartWrapper::Ptr const& upstart_wrapper, |
277 | 97 | ShieldFactoryInterface::Ptr const& shield_factory) | 99 | ShieldFactoryInterface::Ptr const& shield_factory) |
279 | 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) |
280 | 99 | {} | 101 | {} |
281 | 100 | 102 | ||
282 | 101 | using Controller::shields_; | 103 | using Controller::shields_; |
283 | @@ -112,6 +114,7 @@ | |||
284 | 112 | session::MockManager::Ptr session_manager; | 114 | session::MockManager::Ptr session_manager; |
285 | 113 | key::MockGrabber::Ptr key_grabber; | 115 | key::MockGrabber::Ptr key_grabber; |
286 | 114 | DBusManager::Ptr dbus_manager; | 116 | DBusManager::Ptr dbus_manager; |
287 | 117 | unity::SystemdWrapper::Ptr systemd_wrapper; | ||
288 | 115 | unity::UpstartWrapper::Ptr upstart_wrapper; | 118 | unity::UpstartWrapper::Ptr upstart_wrapper; |
289 | 116 | 119 | ||
290 | 117 | ShieldFactoryMock::Ptr shield_factory; | 120 | ShieldFactoryMock::Ptr shield_factory; |
291 | 118 | 121 | ||
292 | === modified file 'tools/CMakeLists.txt' | |||
293 | --- tools/CMakeLists.txt 2016-02-09 01:26:22 +0000 | |||
294 | +++ tools/CMakeLists.txt 2016-07-20 15:08:18 +0000 | |||
295 | @@ -6,3 +6,27 @@ | |||
296 | 6 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity) | 6 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity) |
297 | 7 | install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ | 7 | install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ |
298 | 8 | GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) | 8 | GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) |
299 | 9 | |||
300 | 10 | # | ||
301 | 11 | # unity-active-plugins-safety-check | ||
302 | 12 | # | ||
303 | 13 | pkg_check_modules(UAPSC_DEPS REQUIRED libcompizconfig) | ||
304 | 14 | |||
305 | 15 | set(CFLAGS | ||
306 | 16 | ${UAPSC_DEPS_CFLAGS} | ||
307 | 17 | ${UAPSC_DEPS_CFLAGS_OTHER} | ||
308 | 18 | ) | ||
309 | 19 | |||
310 | 20 | string (REPLACE ";" " " CFLAGS "${CFLAGS}") | ||
311 | 21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CFLAGS}") | ||
312 | 22 | |||
313 | 23 | set(LIBS ${UAPSC_DEPS_LIBRARIES}) | ||
314 | 24 | |||
315 | 25 | set(LIB_PATHS ${UAPSC_DEPS_LIBRARY_DIRS}) | ||
316 | 26 | link_directories(${LIB_PATHS}) | ||
317 | 27 | |||
318 | 28 | add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp) | ||
319 | 29 | target_link_libraries(unity-active-plugins-safety-check ${LIBS}) | ||
320 | 30 | install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) | ||
321 | 31 | |||
322 | 32 | install(FILES unity-compiz-profile DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) | ||
323 | 9 | 33 | ||
324 | === added file 'tools/unity-compiz-profile' | |||
325 | --- tools/unity-compiz-profile 1970-01-01 00:00:00 +0000 | |||
326 | +++ tools/unity-compiz-profile 2016-07-20 15:08:18 +0000 | |||
327 | @@ -0,0 +1,25 @@ | |||
328 | 1 | #!/bin/bash | ||
329 | 2 | |||
330 | 3 | set -e | ||
331 | 4 | |||
332 | 5 | # If gnome-session is going to start compiz, | ||
333 | 6 | # we don't want to be the ones doing it. | ||
334 | 7 | |||
335 | 8 | if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then | ||
336 | 9 | echo "GNOME Session is starting Compiz" | ||
337 | 10 | stop ; exit 0 | ||
338 | 11 | fi | ||
339 | 12 | |||
340 | 13 | compiz_profile="ubuntu" | ||
341 | 14 | |||
342 | 15 | if ! /usr/lib/nux/unity_support_test -p; then | ||
343 | 16 | compiz_profile="ubuntu-lowgfx" | ||
344 | 17 | fi | ||
345 | 18 | |||
346 | 19 | echo "Using compiz profile '$compiz_profile'" | ||
347 | 20 | |||
348 | 21 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
349 | 22 | systemctl set-environment --user COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
350 | 23 | |||
351 | 24 | export COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
352 | 25 | exec /usr/lib/unity/unity-active-plugins-safety-check | ||
353 | 0 | 26 | ||
354 | === added file 'tools/unity_active_plugins_safety_check.cpp' | |||
355 | --- tools/unity_active_plugins_safety_check.cpp 1970-01-01 00:00:00 +0000 | |||
356 | +++ tools/unity_active_plugins_safety_check.cpp 2016-07-20 15:08:18 +0000 | |||
357 | @@ -0,0 +1,83 @@ | |||
358 | 1 | /* | ||
359 | 2 | * Copyright (C) 2016 Canonical Ltd | ||
360 | 3 | * | ||
361 | 4 | * This program is free software: you can redistribute it and/or modify | ||
362 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
363 | 6 | * published by the Free Software Foundation. | ||
364 | 7 | * | ||
365 | 8 | * This program is distributed in the hope that it will be useful, | ||
366 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
367 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
368 | 11 | * GNU General Public License for more details. | ||
369 | 12 | * | ||
370 | 13 | * You should have received a copy of the GNU General Public License | ||
371 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
372 | 15 | * | ||
373 | 16 | * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> | ||
374 | 17 | */ | ||
375 | 18 | |||
376 | 19 | #include <ccs.h> | ||
377 | 20 | #include <gio/gio.h> | ||
378 | 21 | |||
379 | 22 | #include <iostream> | ||
380 | 23 | #include <string> | ||
381 | 24 | |||
382 | 25 | extern const CCSInterfaceTable ccsDefaultInterfaceTable; | ||
383 | 26 | |||
384 | 27 | void PluginSetActiveWithDeps(CCSContext* context, std::string const& plugin_name) | ||
385 | 28 | { | ||
386 | 29 | if (plugin_name.empty()) | ||
387 | 30 | return; | ||
388 | 31 | |||
389 | 32 | auto plugin = ccsFindPlugin(context, plugin_name.c_str()); | ||
390 | 33 | |||
391 | 34 | if (!plugin) | ||
392 | 35 | return; | ||
393 | 36 | |||
394 | 37 | auto reqs = ccsPluginGetRequiresPlugins(plugin); | ||
395 | 38 | for (auto req = reqs; req; req = req->next) | ||
396 | 39 | { | ||
397 | 40 | if (req->data && req->data->value) | ||
398 | 41 | { | ||
399 | 42 | std::string name = req->data->value; | ||
400 | 43 | PluginSetActiveWithDeps(context, name.c_str()); | ||
401 | 44 | } | ||
402 | 45 | } | ||
403 | 46 | |||
404 | 47 | if (!ccsPluginIsActive(context, plugin_name.c_str())) { | ||
405 | 48 | std::cout << "Setting plugin '" << plugin_name << "' to active" << std::endl; | ||
406 | 49 | ccsPluginSetActive(plugin, true); | ||
407 | 50 | } | ||
408 | 51 | |||
409 | 52 | auto conflicts = ccsPluginGetConflictPlugins(plugin); | ||
410 | 53 | for (auto con = conflicts; con; con = con->next) | ||
411 | 54 | { | ||
412 | 55 | if (con->data && con->data->value) | ||
413 | 56 | { | ||
414 | 57 | std::string name = con->data->value; | ||
415 | 58 | auto plugin = ccsFindPlugin(context, name.c_str()); | ||
416 | 59 | |||
417 | 60 | if (ccsPluginIsActive(context, name.c_str())) | ||
418 | 61 | { | ||
419 | 62 | std::cout << "Setting plugin '" << name << "' to non-active" << std::endl; | ||
420 | 63 | ccsPluginSetActive(plugin, false); | ||
421 | 64 | } | ||
422 | 65 | } | ||
423 | 66 | } | ||
424 | 67 | } | ||
425 | 68 | |||
426 | 69 | int main() | ||
427 | 70 | { | ||
428 | 71 | auto context = ccsContextNew (0, &ccsDefaultInterfaceTable); | ||
429 | 72 | |||
430 | 73 | if (!context) | ||
431 | 74 | return -1; | ||
432 | 75 | |||
433 | 76 | PluginSetActiveWithDeps(context, "unityshell"); | ||
434 | 77 | |||
435 | 78 | ccsWriteChangedSettings(context); | ||
436 | 79 | g_settings_sync(); | ||
437 | 80 | ccsFreeContext(context); | ||
438 | 81 | |||
439 | 82 | return 0; | ||
440 | 83 | } | ||
441 | 0 | 84 | ||
442 | === modified file 'unity-shared/CMakeLists.txt' | |||
443 | --- unity-shared/CMakeLists.txt 2016-02-25 15:59:41 +0000 | |||
444 | +++ unity-shared/CMakeLists.txt 2016-07-20 15:08:18 +0000 | |||
445 | @@ -59,6 +59,7 @@ | |||
446 | 59 | SearchBarSpinner.cpp | 59 | SearchBarSpinner.cpp |
447 | 60 | SpreadFilter.cpp | 60 | SpreadFilter.cpp |
448 | 61 | StaticCairoText.cpp | 61 | StaticCairoText.cpp |
449 | 62 | SystemdWrapper.cpp | ||
450 | 62 | TextureCache.cpp | 63 | TextureCache.cpp |
451 | 63 | TextInput.cpp | 64 | TextInput.cpp |
452 | 64 | TextureThumbnailProvider.cpp | 65 | TextureThumbnailProvider.cpp |
453 | 65 | 66 | ||
454 | === added file 'unity-shared/SystemdWrapper.cpp' | |||
455 | --- unity-shared/SystemdWrapper.cpp 1970-01-01 00:00:00 +0000 | |||
456 | +++ unity-shared/SystemdWrapper.cpp 2016-07-20 15:08:18 +0000 | |||
457 | @@ -0,0 +1,88 @@ | |||
458 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 3 -*- | ||
459 | 2 | /* | ||
460 | 3 | * Copyright © 2016 Canonical Ltd | ||
461 | 4 | * | ||
462 | 5 | * This program is free software: you can redistribute it and/or modify | ||
463 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
464 | 7 | * published by the Free Software Foundation. | ||
465 | 8 | * | ||
466 | 9 | * This program is distributed in the hope that it will be useful, | ||
467 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
468 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
469 | 12 | * GNU General Public License for more details. | ||
470 | 13 | * | ||
471 | 14 | * You should have received a copy of the GNU General Public License | ||
472 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
473 | 16 | * | ||
474 | 17 | * Authored by: Ted Gould <ted@canonical.com> | ||
475 | 18 | */ | ||
476 | 19 | |||
477 | 20 | #include "SystemdWrapper.h" | ||
478 | 21 | |||
479 | 22 | #include <UnityCore/GLibDBusProxy.h> | ||
480 | 23 | |||
481 | 24 | namespace unity | ||
482 | 25 | { | ||
483 | 26 | |||
484 | 27 | // | ||
485 | 28 | // Start private implementation | ||
486 | 29 | // | ||
487 | 30 | |||
488 | 31 | class SystemdWrapper::Impl | ||
489 | 32 | { | ||
490 | 33 | public: | ||
491 | 34 | Impl(); | ||
492 | 35 | |||
493 | 36 | void Start(std::string const& name); | ||
494 | 37 | void Stop(std::string const& name); | ||
495 | 38 | |||
496 | 39 | private: | ||
497 | 40 | glib::DBusProxy::Ptr systemd_proxy_; | ||
498 | 41 | }; | ||
499 | 42 | |||
500 | 43 | SystemdWrapper::Impl::Impl() | ||
501 | 44 | { | ||
502 | 45 | std::string busname = "org.freedesktop.systemd1"; | ||
503 | 46 | if (g_getenv("UNITY_TEST_SYSTEMD)")) { | ||
504 | 47 | busname = "com.canonical.Unity.Test.Systemd"; | ||
505 | 48 | } | ||
506 | 49 | |||
507 | 50 | systemd_proxy_ = std::make_shared<unity::glib::DBusProxy>(busname, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager"); | ||
508 | 51 | } | ||
509 | 52 | |||
510 | 53 | void SystemdWrapper::Impl::Start(std::string const& name) | ||
511 | 54 | { | ||
512 | 55 | systemd_proxy_->Call("StartUnit", g_variant_new("(ss)", name.c_str(), "replace")); | ||
513 | 56 | } | ||
514 | 57 | |||
515 | 58 | void SystemdWrapper::Impl::Stop(std::string const& name) | ||
516 | 59 | { | ||
517 | 60 | systemd_proxy_->Call("StopUnit", g_variant_new("(ss)", name.c_str(), "replace")); | ||
518 | 61 | } | ||
519 | 62 | |||
520 | 63 | // | ||
521 | 64 | // End private implementation | ||
522 | 65 | // | ||
523 | 66 | |||
524 | 67 | SystemdWrapper::SystemdWrapper() | ||
525 | 68 | : pimpl_(new Impl) | ||
526 | 69 | {} | ||
527 | 70 | |||
528 | 71 | SystemdWrapper::SystemdWrapper(SystemdWrapper::TestMode const& tm) | ||
529 | 72 | : pimpl_(new Impl) | ||
530 | 73 | {} | ||
531 | 74 | |||
532 | 75 | SystemdWrapper::~SystemdWrapper() | ||
533 | 76 | {} | ||
534 | 77 | |||
535 | 78 | void SystemdWrapper::Start(std::string const& name) | ||
536 | 79 | { | ||
537 | 80 | pimpl_->Start(name); | ||
538 | 81 | } | ||
539 | 82 | |||
540 | 83 | void SystemdWrapper::Stop(std::string const& name) | ||
541 | 84 | { | ||
542 | 85 | pimpl_->Stop(name); | ||
543 | 86 | } | ||
544 | 87 | |||
545 | 88 | } | ||
546 | 0 | 89 | ||
547 | === added file 'unity-shared/SystemdWrapper.h' | |||
548 | --- unity-shared/SystemdWrapper.h 1970-01-01 00:00:00 +0000 | |||
549 | +++ unity-shared/SystemdWrapper.h 2016-07-20 15:08:18 +0000 | |||
550 | @@ -0,0 +1,54 @@ | |||
551 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
552 | 2 | /* | ||
553 | 3 | * Copyright © 2016 Canonical Ltd | ||
554 | 4 | * | ||
555 | 5 | * This program is free software: you can redistribute it and/or modify | ||
556 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
557 | 7 | * published by the Free Software Foundation. | ||
558 | 8 | * | ||
559 | 9 | * This program is distributed in the hope that it will be useful, | ||
560 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
561 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
562 | 12 | * GNU General Public License for more details. | ||
563 | 13 | * | ||
564 | 14 | * You should have received a copy of the GNU General Public License | ||
565 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
566 | 16 | * | ||
567 | 17 | * Authored by: Ted Gould <ted@canonical.com> | ||
568 | 18 | */ | ||
569 | 19 | |||
570 | 20 | #ifndef UNITY_SYSTEMD_WRAPPER | ||
571 | 21 | #define UNITY_SYSTEMD_WRAPPER | ||
572 | 22 | |||
573 | 23 | #include <memory> | ||
574 | 24 | |||
575 | 25 | namespace unity | ||
576 | 26 | { | ||
577 | 27 | |||
578 | 28 | class SystemdWrapper | ||
579 | 29 | { | ||
580 | 30 | public: | ||
581 | 31 | typedef std::shared_ptr<SystemdWrapper> Ptr; | ||
582 | 32 | |||
583 | 33 | SystemdWrapper(); | ||
584 | 34 | ~SystemdWrapper(); | ||
585 | 35 | |||
586 | 36 | void Start(std::string const& name); | ||
587 | 37 | void Stop(std::string const& name); | ||
588 | 38 | |||
589 | 39 | protected: | ||
590 | 40 | struct TestMode {}; | ||
591 | 41 | SystemdWrapper(TestMode const&); | ||
592 | 42 | |||
593 | 43 | private: | ||
594 | 44 | // Noncopyable | ||
595 | 45 | SystemdWrapper(SystemdWrapper const&) = delete; | ||
596 | 46 | SystemdWrapper& operator=(SystemdWrapper const&) = delete; | ||
597 | 47 | |||
598 | 48 | class Impl; | ||
599 | 49 | std::unique_ptr<Impl> pimpl_; | ||
600 | 50 | }; | ||
601 | 51 | |||
602 | 52 | } | ||
603 | 53 | |||
604 | 54 | #endif |
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