fetchmail-friends
[Top] [All Lists]

[fetchmail][RFC] --daemon taking an optional (instead of required) argument

2001-03-26 10:19:28
The current behaviour of --daemon (the command-line option) makes it somewhat
awkward to have fetchmail go into daemon mode by default. This happens
because since command line globals overwrite those defined in the config file,
the value of poll_interval set by "set daemon" in the config file will be
ignored.

In Debian, this resulted in a mess where the user has to go poke in
/etc/default/fetchmail if he wants to change the default daemon poll
interval (and --daemon is there because I've found that users can't be
bothered to add set daemon to their root fetchmail daemon configs).

The attached patches change --daemon (and -d) to accept an optional argument
instead of a required one. If no argument is given, either the value used
in the config file ("set daemon") or a default of 300 is used.

There is one unfortunate side-effect, though. -d 1000 and --daemon 1000 will
NOT work. One would be required to use -d1000 or --daemon=1000.  This is
caused by braindamage in GNU getopts, AFAIK.

This result in a change for the command-line syntax for -d and --daemon.
People using the suggested -dNNN form wouldn't be affected.

Eric, what do you think?  Would you consider applying such a patch to
fetchmail (I'll write the documentation update in that case), or is it more
trouble than it is worth ?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh