fetchmail-friends
[Top] [All Lists]

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

2001-03-28 17:55:39
Henrique de Moraes Holschuh <hmh(_at_)debian(_dot_)org>:
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 ?

You haven't justified it sufficiently.  I don't understand why it's useful
to support --daemon with no argument.
-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>

Power concedes nothing without a demand. It never did, and it never will.
Find out just what people will submit to, and you have found out the exact
amount of injustice and wrong which will be imposed upon them; and these will
continue until they are resisted with either words or blows, or with both.
The limits of tyrants are prescribed by the endurance of those whom they
oppress.
        -- Frederick Douglass, August 4, 1857