[systemd-devel] [PATCH] gnome-ask-password-agent: do not double fork spawned process

Michael Laß bevan at bi-co.net
Tue Aug 13 14:42:28 PDT 2013


pkexec does not like being a lonely child:
"Refusing to render service to dead parents."

Do not double fork when spawning the process by using the DO_NOT_REAP_CHILD
flag. Instead clean up manually by calling waitpid.
---
 src/gnome-ask-password-agent.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gnome-ask-password-agent.vala b/src/gnome-ask-password-agent.vala
index 0f6284d..cff1e58 100644
--- a/src/gnome-ask-password-agent.vala
+++ b/src/gnome-ask-password-agent.vala
@@ -220,7 +220,7 @@ public class MyStatusIcon : StatusIcon {
                                         null,
                                         { "/usr/bin/pkexec", "/lib/systemd/systemd-reply-password", result == ResponseType.OK ? "1" : "0", socket },
                                         null,
-                                        0,
+                                        GLib.SpawnFlags.DO_NOT_REAP_CHILD,
                                         null,
                                         null,
                                         out to_process,
@@ -236,6 +236,7 @@ public class MyStatusIcon : StatusIcon {
                 } catch (Error e) {
                         show_error(e.message);
                 }
+                waitpid(0, null, 0);
         }
 }
 
-- 
1.8.3.4



More information about the systemd-devel mailing list