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
1=== modified file 'configure.ac'
2--- configure.ac 2015-02-16 00:30:20 +0000
3+++ configure.ac 2015-05-06 09:34:52 +0000
4@@ -132,6 +132,19 @@
5 ])
6
7 dnl ###########################################################################
8+
9+AC_ARG_ENABLE([kill-on-sigterm],
10+ AC_HELP_STRING([--enable-kill-on-sigterm], [Kill greeter instance on SIGTERM, see LP1445461])
11+ AC_HELP_STRING([--disable-kill-on-sigterm], [Don't kill greeter on SIGTERM, see LP1445461']),
12+ [], [enable_kill_on_sigterm=no])
13+
14+AS_IF([test "x$enable_kill_on_sigterm" = "xyes"],
15+[
16+ AC_DEFINE([KILL_ON_SIGTERM], [1], [Kill greeter in SIGTERM handler, see LP1445461])
17+],
18+[])
19+
20+dnl ###########################################################################
21 dnl Internationalization
22 dnl ###########################################################################
23
24
25=== modified file 'src/lightdm-gtk-greeter.c'
26--- src/lightdm-gtk-greeter.c 2015-03-27 05:29:45 +0000
27+++ src/lightdm-gtk-greeter.c 2015-05-06 09:34:52 +0000
28@@ -423,10 +423,27 @@
29 static void
30 sigterm_cb (gpointer user_data)
31 {
32- g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));
33- g_slist_free (pids_to_close);
34- pids_to_close = NULL;
35- gtk_main_quit ();
36+ gboolean is_callback = GPOINTER_TO_INT (user_data);
37+
38+ if (is_callback)
39+ g_debug ("SIGTERM received");
40+
41+ if (pids_to_close)
42+ {
43+ g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));
44+ g_slist_free (pids_to_close);
45+ pids_to_close = NULL;
46+ }
47+
48+ if (is_callback)
49+ {
50+ gtk_main_quit ();
51+ #ifdef KILL_ON_SIGTERM
52+ /* LP: #1445461 */
53+ g_debug ("Killing greeter with exit()...");
54+ exit (EXIT_SUCCESS);
55+ #endif
56+ }
57 }
58
59 /* Power window */
60@@ -2572,7 +2589,7 @@
61 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
62 textdomain (GETTEXT_PACKAGE);
63
64- g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, NULL);
65+ g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, /* is_callback */ GINT_TO_POINTER (TRUE));
66
67 config_init ();
68
69@@ -3072,9 +3089,11 @@
70
71 gtk_widget_show (GTK_WIDGET (screen_overlay));
72
73+ g_debug ("Run Gtk loop...");
74 gtk_main ();
75+ g_debug ("Gtk loop exits");
76
77- g_slist_foreach (pids_to_close, (GFunc)close_pid, NULL);
78+ sigterm_cb (/* is_callback */ GINT_TO_POINTER (FALSE));
79
80 return EXIT_SUCCESS;
81 }

Subscribers

People subscribed via source and target branches