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

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 252
Merged at revision: 242
Proposed branch: lp:~ted/indicator-application/upstart-job
Merge into: lp:indicator-application/14.04
Diff against target: 149 lines (+70/-20)
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 (+31/-0)
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
Charles Kerr (community) Approve
Review via email: mp+192975@code.launchpad.net

This proposal supersedes a proposal from 2013-05-29.

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 : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

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:05:17 +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:05:17 +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:05:17 +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:05:17 +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:05:17 +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 2013-10-23 17:05:33 +0000
112+++ src/application-service-watcher.c 2013-10-29 00:05:17 +0000
113@@ -288,5 +288,36 @@
114 return;
115 }
116
117+ /* After we've got the name we can request upstart to trigger
118+ the jobs of any application indicators that need to start
119+ at desktop init time. */
120+
121+ GError * spawn_error = NULL;
122+ gchar * argv[] = {
123+ "initctl",
124+ "--session",
125+ "--user",
126+ "emit",
127+ "--no-wait",
128+ "appindicators-start",
129+ NULL,
130+ };
131+
132+ g_spawn_async(NULL, /* Working Directory */
133+ argv,
134+ NULL, /* environment */
135+ G_SPAWN_SEARCH_PATH,
136+ NULL, NULL, /* child setup function */
137+ NULL, /* Pid */
138+ &spawn_error);
139+
140+ if (spawn_error != NULL) {
141+ /* NOTE: When we get to the point where we can start
142+ assuming upstart user sessions this can be escillated
143+ to a warning or higher */
144+ g_debug("Unable to signal appindicators-start to upstart: %s", spawn_error->message);
145+ g_error_free(spawn_error);
146+ }
147+
148 return;
149 }

Subscribers

People subscribed via source and target branches