From: Matthias A. <mat...@gm...> - 2021-11-05 18:10:43
|
Am 05.11.21 um 15:21 schrieb isdtor: > G'day all, > > After updating to release 6.4.23, I noticed that the .pid file had an unusual size here, 9 bytes instead of 6. > > $ cat ~/.fetchmail.pid > 12345 > 42 > $ > > The first line certainly corresponds to the running pid, and fetchmail -q continues to work fine. The second line represents the daemon interval, and the entry is created regardless whether I use -d on the command line or set daemon xx in the .rc file. > > I did a very quick diff of the 6.4.22 and 6.4.23 sources and found no reference to pidfile, which makes me think this is not a change introduced by 6.4.23. Obviously, in my opinion, the daemon interval should not be recorded in the pid file. Surprise: This is documented in the manual page: > --pidfile <pathname> > (Keyword: pidfile; since fetchmail v6.3.4) > Override the default location of the PID file that is > used as a lock file. Default: see "ENVIRONMENT" below. Note > that many places in the code and documentation, the term > "lock file" is used. This file contains the process ID > of the running fetchmail on the first line and > potentially the daemon interval on a second line. Bigger surprise: It is in line with the Linux Filesystem Hierarchy Standard 3.0, section 3.15.2 in https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html It is also in line with what FreeBSD's rc.subr expects. All pidfile stuff I know expects the PID on the first line only and is to ignore what's on subsequent lines. History lesson (it's all in Git, all public): Code to log the daemon's poll interval was added to fetchmail 25 years ago, into fetchmail.c at the time, later refactored into lock.c (see below for the commit banner). Released in fetchmail-1.9.0 (Fri Oct 25 23:02:26 EDT 1996). See OLDNEWS for the release note... Now what? >> commit 7c01a0bb7d66715319fa94626a963e8389375858 >> Author: Eric S. Raymond <es...@th...> >> Date: Sun Oct 13 15:46:55 1996 +0000 >> >> Added wakeup feature. >> >> svn path=/trunk/; revision=323 >> >> NEWS | 4 ++++ >> fetchmail.c | 59 >> ++++++++++++++++++++++++++++++++++++++++++++++++++--------- >> fetchmail.man | 4 +++- >> 3 files changed, 57 insertions(+), 10 deletions(-) |