summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <[email protected]>2014-04-08 15:57:59 +1200
committergit-ubuntu importer <[email protected]>2014-04-08 11:33:45 +0000
commitf8363cd60fa29c584832683a917ca9e5fa6c02b7 (patch)
tree967629491cbaabc94330b0550681eba5bd3b1bcf
parentbc0fa693f9f02fcb4c0bf09d206ac50e8c063d60 (diff)
14.04.9-0ubuntu1 (patches unapplied)import/14.04.9-0ubuntu1ubuntu/trusty
Imported using git-ubuntu import.
Notes
Notes: * New upstream release: - Correctly handle SIGTERM and quit cleanly. We were previously not stopping the signal and so not cleaning up on exit. This left an upstart process for each greeter remaining. - If a user has an invalid session, then use the system default session (LP: #1303725) - Correctly handle sessions not starting
-rw-r--r--NEWS8
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog12
-rw-r--r--src/fixes.vapi6
-rw-r--r--src/greeter-list.vala9
-rw-r--r--src/menubar.vala2
-rw-r--r--src/unity-greeter.vala74
-rw-r--r--tests/unity-greeter.vala3
8 files changed, 91 insertions, 25 deletions
diff --git a/NEWS b/NEWS
index 78289e1c..81c73b47 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Overview of changes in unity-greeter 14.04.9
+
+ - Correctly handle SIGTERM and quit cleanly. We were previously not stopping
+ the signal and so not cleaning up on exit. This left an upstart process
+ for each greeter remaining.
+ - If a user has an invalid session, then use the system default session
+ - Correctly handle sessions not starting
+
Overview of changes in unity-greeter 14.04.8
- Allow unity-settings-daemon to blank the screen by implementing the
diff --git a/configure.ac b/configure.ac
index 48fc7978..714aa5a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(unity-greeter, 14.04.8)
+AC_INIT(unity-greeter, 14.04.9)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
diff --git a/debian/changelog b/debian/changelog
index 4a119500..6d5215ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+unity-greeter (14.04.9-0ubuntu1) trusty; urgency=medium
+
+ * New upstream release:
+ - Correctly handle SIGTERM and quit cleanly. We were previously not stopping
+ the signal and so not cleaning up on exit. This left an upstart process
+ for each greeter remaining.
+ - If a user has an invalid session, then use the system default session
+ (LP: #1303725)
+ - Correctly handle sessions not starting
+
+ -- Robert Ancell <[email protected]> Tue, 08 Apr 2014 15:57:59 +1200
+
unity-greeter (14.04.8-0ubuntu1) trusty; urgency=medium
* New upstream release:
diff --git a/src/fixes.vapi b/src/fixes.vapi
index 07ee171d..8d083708 100644
--- a/src/fixes.vapi
+++ b/src/fixes.vapi
@@ -49,3 +49,9 @@ namespace Gnome
public delegate void IdleMonitorWatchFunc (IdleMonitor monitor, uint id);
}
+
+// Note, fixed in 1.10.0
+namespace LightDM
+{
+ bool greeter_start_session_sync (LightDM.Greeter greeter, string session) throws GLib.Error;
+}
diff --git a/src/greeter-list.vala b/src/greeter-list.vala
index 8f4e74c3..7ed30e10 100644
--- a/src/greeter-list.vala
+++ b/src/greeter-list.vala
@@ -908,11 +908,16 @@ public abstract class GreeterList : FadableBox
private void start_session ()
{
+ if (!UnityGreeter.singleton.start_session (get_lightdm_session (), background))
+ {
+ show_message (_("Failed to start session"), true);
+ start_authentication ();
+ return;
+ }
+
/* Set the background */
background.draw_grid = false;
background.queue_draw ();
-
- UnityGreeter.singleton.start_session (get_lightdm_session (), background);
}
public void login_complete ()
diff --git a/src/menubar.vala b/src/menubar.vala
index 457c1118..79783da9 100644
--- a/src/menubar.vala
+++ b/src/menubar.vala
@@ -158,7 +158,7 @@ public class MenuBar : Gtk.MenuBar
private void close_pid (ref Pid pid)
{
- if (pid != 0)
+ if (pid > 0)
{
Posix.kill (pid, Posix.SIGTERM);
int status;
diff --git a/src/unity-greeter.vala b/src/unity-greeter.vala
index d1e3d91d..cf501af4 100644
--- a/src/unity-greeter.vala
+++ b/src/unity-greeter.vala
@@ -181,7 +181,7 @@ public class UnityGreeter
ctx.add_class ("lightdm");
}
- public void start_session (string? session, Background bg)
+ public bool start_session (string? session, Background bg)
{
/* Paint our background onto the root window before we close our own window */
var c = new Cairo.Context (background_surface);
@@ -191,21 +191,43 @@ public class UnityGreeter
if (test_mode)
{
- debug ("Successfully logged in! Quitting...");
- Gtk.main_quit ();
+ debug ("Successfully logged in! Quitting...");
+ Gtk.main_quit ();
+ return true;
}
- else
+
+ if (!session_is_valid (session))
{
- starting_session ();
- try
- {
- greeter.start_session_sync (session);
- }
- catch (Error e)
- {
- warning ("Failed to start session: %s", e.message);
- }
+ debug ("Session %s is not available, using system default %s instead", session, greeter.default_session_hint);
+ session = greeter.default_session_hint;
+ }
+
+ var result = false;
+ try
+ {
+ result = LightDM.greeter_start_session_sync (greeter, session);
+ }
+ catch (Error e)
+ {
+ warning ("Failed to start session: %s", e.message);
}
+
+ if (result)
+ starting_session ();
+
+ return result;
+ }
+
+ private bool session_is_valid (string? session)
+ {
+ if (session == null)
+ return true;
+
+ foreach (var s in LightDM.get_sessions ())
+ if (s.key == session)
+ return true;
+
+ return false;
}
private bool ready_cb ()
@@ -446,7 +468,7 @@ public class UnityGreeter
Environment.set_variable ("GTK_MODULES", "atk-bridge", false);
Pid atspi_pid = 0;
- Pid indicator_pid = 0;
+ Pid upstart_pid = 0;
try
{
@@ -558,7 +580,7 @@ public class UnityGreeter
null,
SpawnFlags.SEARCH_PATH,
null,
- out indicator_pid);
+ out upstart_pid);
}
catch (Error e)
{
@@ -582,18 +604,24 @@ public class UnityGreeter
GLib.Unix.signal_add(GLib.ProcessSignal.TERM, () => {
debug("Got a SIGTERM");
Gtk.main_quit();
- return false;
+ return true;
});
debug ("Starting main loop");
Gtk.main ();
- if (indicator_pid != 0)
+ debug ("Cleaning up");
+
+ if (upstart_pid != 0)
{
- Posix.kill (indicator_pid, Posix.SIGTERM);
+ Posix.kill (upstart_pid, Posix.SIGTERM);
int status;
- Posix.waitpid (indicator_pid, out status, 0);
- indicator_pid = 0;
+ Posix.waitpid (upstart_pid, out status, 0);
+ if (Process.if_exited (status))
+ debug ("Upstart exited with return value %d", Process.exit_status (status));
+ else
+ debug ("Upstart terminated with signal %d", Process.term_sig (status));
+ upstart_pid = 0;
}
if (atspi_pid != 0)
@@ -601,9 +629,15 @@ public class UnityGreeter
Posix.kill (atspi_pid, Posix.SIGKILL);
int status;
Posix.waitpid (atspi_pid, out status, 0);
+ if (Process.if_exited (status))
+ debug ("AT-SPI exited with return value %d", Process.exit_status (status));
+ else
+ debug ("AT-SPI terminated with signal %d", Process.term_sig (status));
atspi_pid = 0;
}
+ debug ("Exiting");
+
return Posix.EXIT_SUCCESS;
}
}
diff --git a/tests/unity-greeter.vala b/tests/unity-greeter.vala
index dee4187b..15cbb560 100644
--- a/tests/unity-greeter.vala
+++ b/tests/unity-greeter.vala
@@ -97,9 +97,10 @@ public class UnityGreeter
return _has_guest_account_hint;
}
- public void start_session (string? session, Background bg)
+ public bool start_session (string? session, Background bg)
{
session_started = true;
+ return true;
}
public void push_list (GreeterList widget)