fetchmail-friends
[Top] [All Lists]

[fetchmail] Re: Bug#202787: edit rc file for sure loop

2003-10-29 01:38:52
Quoting from Benjamin Drieu's mail on Wed, Oct 29, 2003 at 08:54:57AM +0100:
here is a patch from a Debian user that fixes a very annoying behavior
of fetchmail as a daemon.  Modifying the rc file could lead fetchmail
to loop infinitely.

...

     bkgd = (pid < 0);
     pid = bkgd ? -pid : pid;
 
-    /* avoid parsing the config file if all we're doing is killing a daemon 
*/ 
-    if (!quitmode && !pid)
+    /*
+     * Avoid parsing the config file if all we're doing is killing a daemon,
+     * unless this appears to be a self-restarted instance because we 
detected an 
+     * "under-our-noses" configuration file change, in which case we 
definitely want
+     * to reload the config file.
+     */
+    if ( ( !quitmode && !pid ) || pid == getpid() )
      implicitmode = load_params(argc, argv, optind);
     else if (pid)
       implicitmode = 1;

This patch is not applicable for 6.2.*. The lockfile is read after the
call to load_params().

-- 
Sunil Shetye.

<Prev in Thread] Current Thread [Next in Thread>