From 12ffba0a7f61b2245e76a66c567cb18ea643ba50 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Tue, 28 Feb 2017 14:20:33 +0100 Subject: [PATCH] Make shell parent of pkexec In case when mtr-gtk is started from gnome-shell we need to make sure that parent process of pkexec is not systemd. This is because pkexec exits with error if it detects that its parent is PID 1 [1]. Execing pkexec was fine before F22, because previously gnome-shell was reaping processes it spawned. Since F22 gnome-shell doesn't do that and it calls g_spawn_async w/o G_SPAWN_DO_NOT_REAP_CHILD flag in which case glib really doesn't bother with reaping child processes properly and instead it does double fork(). Intermediate child process goes away and grand-child is then reparented to PID 1 that will reap it. [2] [1] https://cgit.freedesktop.org/polkit/commit/src/programs/pkexec.c?id=3b12cfac29dddd27f1f166a7574d8374cc1dccf2 [2] https://git.gnome.org/browse/gnome-shell/commit/?id=01c6392c1373cf23786a0dad1b670a511107349c --- mtr-gtk-pkexec-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtr-gtk-pkexec-wrapper.sh b/mtr-gtk-pkexec-wrapper.sh index b1f26f2..d4f7191 100644 --- a/mtr-gtk-pkexec-wrapper.sh +++ b/mtr-gtk-pkexec-wrapper.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec /usr/bin/pkexec /usr/bin/xmtr.bin +/usr/bin/pkexec /usr/bin/xmtr.bin