[PATCH v3 3/5] gpg-agent: Implement --supervised command (for systemd, etc).

NIIBE Yutaka gniibe at fsij.org
Wed Oct 5 08:45:56 CEST 2016


On 10/05/2016 01:51 PM, Daniel Kahn Gillmor wrote:
> 1) when running --supervised, i see regular hangs of the agent which are
>    not seen when it is auto-launched.

Sorry, my change of

    eda1764 * agent, dirmngr, scd: npth_init must be after fork.

interferes, I suppose.

My patch is trying to clean up use of nPth with daemonizing.  It makes
gpg-agent not initialize nPth before fork to be daemon, so that we can
avoid unclear semantics of forked child of threaded application.

I think that in the code path of --supervised, initialize_module
is missing.

I'm writing this without testing.  I'll commit this after test.


diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 9c7b8fc..dcc9bb6 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1456,6 +1456,8 @@ main (int argc, char **argv )
 #ifndef HAVE_W32_SYSTEM
       gnupg_fd_t fd, fd_extra, fd_browser, fd_ssh;

+      initialize_modules ();
+
       /* when supervised and sending logs to stderr, the process
          supervisor should handle log entry metadata (pid, name,
          timestamp) */
-- 



More information about the Gnupg-devel mailing list