fetchmail-friends
[Top] [All Lists]

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

2004-03-16 20:55:03
On Wed, Oct 29, 2003 at 02:15:52PM +0530, Sunil Shetye wrote:
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().

The call to lock_state seems to come before load_params, so I am not
sure what you mean by this.

Regardless, I have tested this patch and can confirm that the problem
exists in 6.2.5, and that the patch above fixes it. Can anybody else
confirm this, or does anyone see any further problems with the patch?

-- 
gram

Attachment: signature.asc
Description: Digital signature

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