Merge lp:~ted/indicator-application/upstart-job into lp:indicator-application/13.10

Proposed by Ted Gould
Status: Superseded
Proposed branch: lp:~ted/indicator-application/upstart-job
Merge into: lp:indicator-application/13.10
Diff against target: 168 lines (+73/-21)
7 files modified
.bzrignore (+2/-0)
configure.ac (+0/-11)
data/Makefile.am (+13/-6)
data/indicator-application.conf.in (+15/-0)
data/indicator-application.desktop.in (+9/-0)
data/indicator-application.service.in (+0/-3)
src/application-service-watcher.c (+34/-1)
To merge this branch: bzr merge lp:~ted/indicator-application/upstart-job
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Indicator Applet Developers Pending
Review via email: mp+166364@code.launchpad.net

This proposal has been superseded by a proposal from 2013-10-29.

Commit message

Upstart job configuration and signal emission.

Description of the change

Switch indicator application over to having an upstart job for managing the service. Also make it emit it's own event for when application indicators should be started so we can clean up the boot sequence.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
250. By Ted Gould

Dropping debugging for system-wide support

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
251. By Ted Gould

Merge trunk

252. By Ted Gould

Adding an XDG Autostart file

Unmerged revisions

252. By Ted Gould

Adding an XDG Autostart file

251. By Ted Gould

Merge trunk

250. By Ted Gould

Dropping debugging for system-wide support

249. By Ted Gould

Add the indicator-services-end condition

248. By Ted Gould

Add the indicator-services-start condition

247. By Ted Gould

Make sure to have proper syntax

246. By Ted Gould

Dropping service from extra dist and clean

245. By Ted Gould

Limiting to only the ubuntu session

244. By Ted Gould

A comment, because comments rock.

243. By Ted Gould

When we get our name, then start app indicators

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-12-18 19:08:50 +0000
3+++ .bzrignore 2013-10-29 00:02:40 +0000
4@@ -110,3 +110,5 @@
5 bindings/mono/policy.0.0.appindicator-sharp.dll
6 src/libapplication_la-generate-id.lo
7 src/libappindicator_la-generate-id.lo
8+indicator-application.conf
9+indicator-application.desktop
10
11=== modified file 'configure.ac'
12--- configure.ac 2013-01-22 20:32:18 +0000
13+++ configure.ac 2013-10-29 00:02:40 +0000
14@@ -89,17 +89,6 @@
15 AC_SUBST(INDICATORICONSDIR)
16
17 ###########################
18-# DBus Service Info
19-###########################
20-
21-if test "x$with_localinstall" = "xyes"; then
22- DBUSSERVICEDIR="${datadir}/dbus-1/services/"
23-else
24- DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
25-fi
26-AC_SUBST(DBUSSERVICEDIR)
27-
28-###########################
29 # Files
30 ###########################
31
32
33=== modified file 'data/Makefile.am'
34--- data/Makefile.am 2010-08-10 21:31:39 +0000
35+++ data/Makefile.am 2013-10-29 00:02:40 +0000
36@@ -1,17 +1,24 @@
37
38-dbus_servicesdir = $(DBUSSERVICEDIR)
39-dbus_services_DATA = indicator-application.service
40-
41-%.service: %.service.in
42+upstart_jobsdir = $(datadir)/upstart/sessions/
43+upstart_jobs_DATA = indicator-application.conf
44+
45+%.conf: %.conf.in
46+ sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
47+
48+xdg_autostartdir = /etc/xdg/autostart
49+xdg_autostart_DATA = indicator-application.desktop
50+
51+%.desktop: %.desktop.in
52 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
53
54 overridedir = $(pkgdatadir)
55 override_DATA = ordering-override.keyfile
56
57 EXTRA_DIST = \
58- indicator-application.service.in \
59+ indicator-application.desktop.in \
60+ indicator-application.conf.in \
61 ordering-override.keyfile
62
63 CLEANFILES = \
64- indicator-application.service
65+ indicator-application.conf
66
67
68=== added file 'data/indicator-application.conf.in'
69--- data/indicator-application.conf.in 1970-01-01 00:00:00 +0000
70+++ data/indicator-application.conf.in 2013-10-29 00:02:40 +0000
71@@ -0,0 +1,15 @@
72+description "Indicator Application Service"
73+
74+# NOTE: Limiting only to Unity 7 right now as it's still using
75+# dbusmenu. That can be lifted after it is ported to GMenu
76+
77+start on (indicators-loaded or indicator-services-start) and xsession SESSION=ubuntu
78+stop on desktop-end or indicator-services-end
79+
80+emits appindicators-start appindicators-end
81+
82+respawn
83+
84+exec @libexecdir@/indicator-application-service
85+
86+pre-stop exec initctl emit appindicators-end
87
88=== added file 'data/indicator-application.desktop.in'
89--- data/indicator-application.desktop.in 1970-01-01 00:00:00 +0000
90+++ data/indicator-application.desktop.in 2013-10-29 00:02:40 +0000
91@@ -0,0 +1,9 @@
92+[Desktop Entry]
93+Type=Application
94+Name=Indicator Application
95+Exec=@libexecdir@/indicator-application-service
96+NotShowIn=Unity;
97+NoDisplay=true
98+StartupNotify=false
99+Terminal=false
100+
101
102=== removed file 'data/indicator-application.service.in'
103--- data/indicator-application.service.in 2011-01-14 02:10:12 +0000
104+++ data/indicator-application.service.in 1970-01-01 00:00:00 +0000
105@@ -1,3 +0,0 @@
106-[D-BUS Service]
107-Name=com.canonical.indicator.application
108-Exec=@libexecdir@/indicator-application-service
109
110=== modified file 'src/application-service-watcher.c'
111--- src/application-service-watcher.c 2012-12-18 19:08:50 +0000
112+++ src/application-service-watcher.c 2013-10-29 00:02:40 +0000
113@@ -24,6 +24,7 @@
114 #include "config.h"
115 #endif
116
117+#include <stdlib.h>
118 #include <dbus/dbus-glib.h>
119 #include <dbus/dbus-glib-lowlevel.h>
120 #include <dbus/dbus-glib-bindings.h>
121@@ -158,8 +159,9 @@
122 GError * error = NULL;
123 DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
124 if (error != NULL) {
125- g_error("Unable to get session bus: %s", error->message);
126+ g_warning("Unable to get session bus: %s", error->message);
127 g_error_free(error);
128+ exit(0);
129 return;
130 }
131
132@@ -286,5 +288,36 @@
133 return;
134 }
135
136+ /* After we've got the name we can request upstart to trigger
137+ the jobs of any application indicators that need to start
138+ at desktop init time. */
139+
140+ GError * spawn_error = NULL;
141+ gchar * argv[] = {
142+ "initctl",
143+ "--session",
144+ "--user",
145+ "emit",
146+ "--no-wait",
147+ "appindicators-start",
148+ NULL,
149+ };
150+
151+ g_spawn_async(NULL, /* Working Directory */
152+ argv,
153+ NULL, /* environment */
154+ G_SPAWN_SEARCH_PATH,
155+ NULL, NULL, /* child setup function */
156+ NULL, /* Pid */
157+ &spawn_error);
158+
159+ if (spawn_error != NULL) {
160+ /* NOTE: When we get to the point where we can start
161+ assuming upstart user sessions this can be escillated
162+ to a warning or higher */
163+ g_debug("Unable to signal appindicators-start to upstart: %s", spawn_error->message);
164+ g_error_free(spawn_error);
165+ }
166+
167 return;
168 }

Subscribers

People subscribed via source and target branches