Merge lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/lp-1445461-leave-instance into lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk

Proposed by Andrew P.
Status: Merged
Merged at revision: 331
Proposed branch: lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/lp-1445461-leave-instance
Merge into: lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk
Diff against target: 81 lines (+38/-6)
2 files modified
configure.ac (+13/-0)
src/lightdm-gtk-greeter.c (+25/-6)
To merge this branch: bzr merge lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/lp-1445461-leave-instance
Reviewer Review Type Date Requested Status
Sean Davis Approve
Review via email: mp+258352@code.launchpad.net

Description of the change

Greeter can hangs after getting SIGTERM with Gtk > 3.15.
Details:
https://bugs.launchpad.net/lightdm-gtk-greeter/+bug/1441356/comments/1

This patch adds new configure option for distributions with Gtk 3.16:
--enable-kill-on-sigterm

There is no need to use it with ubuntu now.

To post a comment you must log in.
Revision history for this message
Sean Davis (bluesabre) wrote :

Are the debug messages only displayed if the debug option is TRUE?

Revision history for this message
Andrew P. (kalgasnik) wrote :

Yes.

Revision history for this message
Sean Davis (bluesabre) wrote :

Thought so. Just wanted to make sure we didn't have any extra debug messages.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2015-02-16 00:30:20 +0000
+++ configure.ac 2015-05-06 09:34:52 +0000
@@ -132,6 +132,19 @@
132])132])
133133
134dnl ###########################################################################134dnl ###########################################################################
135
136AC_ARG_ENABLE([kill-on-sigterm],
137 AC_HELP_STRING([--enable-kill-on-sigterm], [Kill greeter instance on SIGTERM, see LP1445461])
138 AC_HELP_STRING([--disable-kill-on-sigterm], [Don't kill greeter on SIGTERM, see LP1445461']),
139 [], [enable_kill_on_sigterm=no])
140
141AS_IF([test "x$enable_kill_on_sigterm" = "xyes"],
142[
143 AC_DEFINE([KILL_ON_SIGTERM], [1], [Kill greeter in SIGTERM handler, see LP1445461])
144],
145[])
146
147dnl ###########################################################################
135dnl Internationalization148dnl Internationalization
136dnl ###########################################################################149dnl ###########################################################################
137150
138151
=== modified file 'src/lightdm-gtk-greeter.c'
--- src/lightdm-gtk-greeter.c 2015-03-27 05:29:45 +0000
+++ src/lightdm-gtk-greeter.c 2015-05-06 09:34:52 +0000
@@ -423,10 +423,27 @@
423static void423static void
424sigterm_cb (gpointer user_data)424sigterm_cb (gpointer user_data)
425{425{
426 g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));426 gboolean is_callback = GPOINTER_TO_INT (user_data);
427 g_slist_free (pids_to_close);427
428 pids_to_close = NULL;428 if (is_callback)
429 gtk_main_quit ();429 g_debug ("SIGTERM received");
430
431 if (pids_to_close)
432 {
433 g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));
434 g_slist_free (pids_to_close);
435 pids_to_close = NULL;
436 }
437
438 if (is_callback)
439 {
440 gtk_main_quit ();
441 #ifdef KILL_ON_SIGTERM
442 /* LP: #1445461 */
443 g_debug ("Killing greeter with exit()...");
444 exit (EXIT_SUCCESS);
445 #endif
446 }
430}447}
431448
432/* Power window */449/* Power window */
@@ -2572,7 +2589,7 @@
2572 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");2589 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
2573 textdomain (GETTEXT_PACKAGE);2590 textdomain (GETTEXT_PACKAGE);
25742591
2575 g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, NULL);2592 g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, /* is_callback */ GINT_TO_POINTER (TRUE));
25762593
2577 config_init ();2594 config_init ();
25782595
@@ -3072,9 +3089,11 @@
30723089
3073 gtk_widget_show (GTK_WIDGET (screen_overlay));3090 gtk_widget_show (GTK_WIDGET (screen_overlay));
30743091
3092 g_debug ("Run Gtk loop...");
3075 gtk_main ();3093 gtk_main ();
3094 g_debug ("Gtk loop exits");
30763095
3077 g_slist_foreach (pids_to_close, (GFunc)close_pid, NULL);3096 sigterm_cb (/* is_callback */ GINT_TO_POINTER (FALSE));
30783097
3079 return EXIT_SUCCESS;3098 return EXIT_SUCCESS;
3080}3099}

Subscribers

People subscribed via source and target branches