El dom, 05-03-2006 a las 11:42 -0800, Kevin Dalley escribió: > Package: fetchmail > Version: 6.3.2-2 > Severity: serious > Justification: Policy 9.1.1 > > fetchmail uses the file /var/lib/fetchmail/.fetchmail.pid, which is > not cleaned up on startup. A system crash causes fetchmail to believe > that it is still running, and the server is not restarted. /var/run should > be used instead. > > Patch to allow the pid file to be on /var/run/fetchmail leaving fetchmail home on /var/lib/fetchmail This would make it comply with FHS.
I'm not uploading this patch yet, since I'm waiting to hear upstream opinion on the patch. Regards, Héctor
Index: fetchmail.c
===================================================================
--- fetchmail.c (revision 332)
+++ fetchmail.c (working copy)
@@ -66,6 +66,7 @@
char *user; /* the name of the invoking user */
char *home; /* invoking user's home directory */
char *fmhome; /* fetchmail's home directory */
+char *fmpiddir; /* fetchmail's pid directory */
char *program_name; /* the name to prefix error messages with */
flag configdump; /* dump control blocks for configurator */
char *fetchmailhost; /* either `localhost' or the host's FQDN */
Index: fetchmail.h
===================================================================
--- fetchmail.h (revision 332)
+++ fetchmail.h (working copy)
@@ -430,6 +430,7 @@
extern char *user; /* name of invoking user */
extern char *home; /* home directory of invoking user */
extern char *fmhome; /* fetchmail home directory */
+extern char *fmpiddir; /* fetchmail pid directory */
extern int pass; /* number of re-polling pass */
extern flag configdump; /* dump control blocks as Python dictionary */
extern char *fetchmailhost; /* either "localhost" or an FQDN */
Index: lock.c
===================================================================
--- lock.c (revision 332)
+++ lock.c (working copy)
@@ -37,10 +37,10 @@
strcat(lockfile, "/");
strcat(lockfile, FETCHMAIL_PIDFILE);
} else {
- lockfile = (char *)xmalloc(strlen(fmhome)+sizeof(FETCHMAIL_PIDFILE)+2);
- strcpy(lockfile, fmhome);
+ lockfile = (char *)xmalloc(strlen(fmpiddir)+sizeof(FETCHMAIL_PIDFILE)+2);
+ strcpy(lockfile, fmpiddir);
strcat(lockfile, "/");
- if (fmhome == home)
+ if (fmpiddir == home)
strcat(lockfile, ".");
strcat(lockfile, FETCHMAIL_PIDFILE);
}
Index: env.c
===================================================================
--- env.c (revision 332)
+++ env.c (working copy)
@@ -111,6 +111,10 @@
if (!(fmhome = getenv("FETCHMAILHOME")))
fmhome = home;
+ /* compute fetchmail's pid directory */
+ if (!(fmpiddir = getenv("FETCHMAILPIDDIR")))
+ fmpiddir = fmhome;
+
#define RCFILE_NAME "fetchmailrc"
/*
* The (fmhome==home) leaves an extra character for a . at the
signature.asc
Description: Esta parte del mensaje está firmada digitalmente

