Merge lp:~ted/unity-greeter/upstart-indicators into lp:unity-greeter

Proposed by Ted Gould
Status: Merged
Approved by: Michael Terry
Approved revision: 1005
Merged at revision: 1014
Proposed branch: lp:~ted/unity-greeter/upstart-indicators
Merge into: lp:unity-greeter
Diff against target: 61 lines (+34/-0)
1 file modified
src/unity-greeter.vala (+34/-0)
To merge this branch: bzr merge lp:~ted/unity-greeter/upstart-indicators
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+192936@code.launchpad.net

Commit message

Use an Upstart process to start indicator services

Description of the change

Uses a custom Upstart session to start the indicators.

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

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-greeter.vala'
2--- src/unity-greeter.vala 2013-10-02 17:46:49 +0000
3+++ src/unity-greeter.vala 2013-10-28 19:17:53 +0000
4@@ -408,6 +408,7 @@
5 Environment.set_variable ("GTK_MODULES", "atk-bridge", false);
6
7 Pid atspi_pid = 0;
8+ Pid indicator_pid = 0;
9
10 try
11 {
12@@ -508,6 +509,24 @@
13
14 if (!do_test_mode)
15 {
16+ /* Start the indicator services */
17+ try
18+ {
19+ string[] argv;
20+
21+ Shell.parse_argv ("init --user --startup-event indicator-services-start", out argv);
22+ Process.spawn_async (null,
23+ argv,
24+ null,
25+ SpawnFlags.SEARCH_PATH,
26+ null,
27+ out indicator_pid);
28+ }
29+ catch (Error e)
30+ {
31+ warning ("Error starting Upstart for indicators: %s", e.message);
32+ }
33+
34 /* Make nm-applet hide items the user does not have permissions to interact with */
35 Environment.set_variable ("NM_APPLET_HIDE_POLICY_ITEMS", "1", true);
36
37@@ -521,9 +540,24 @@
38 }
39 }
40
41+ /* Setup a handler for TERM so we quit cleanly */
42+ GLib.Unix.signal_add(GLib.ProcessSignal.TERM, () => {
43+ debug("Got a SIGTERM");
44+ Gtk.main_quit();
45+ return false;
46+ });
47+
48 debug ("Starting main loop");
49 Gtk.main ();
50
51+ if (indicator_pid != 0)
52+ {
53+ Posix.kill (indicator_pid, Posix.SIGTERM);
54+ int status;
55+ Posix.waitpid (indicator_pid, out status, 0);
56+ indicator_pid = 0;
57+ }
58+
59 if (atspi_pid != 0)
60 {
61 Posix.kill (atspi_pid, Posix.SIGKILL);

Subscribers

People subscribed via source and target branches