PPP Daemon "lessdebug" patch
v1.0 - Toby Reed <toby@eskimo.com>
----------------------------------

DESCRIPTION

This patch to pppd adds a new feature called "lessdebug". It works with
the command line argument "lessdebug". Pretty creative, huh? You can also
use "-ld" to save hard disk space in your script files. Anyway, with this 
option enabled, your logs will only contain messages from pppd that are
classified as errors or below, as shown in this chart, taken from the
"syslog" manual page:

#define KERN_EMERG    "<0>"  /* system is unusable               */
#define KERN_ALERT    "<1>"  /* action must be taken immediately */
#define KERN_CRIT     "<2>"  /* critical conditions              */
#define KERN_ERR      "<3>"  /* error conditions                 */
#define KERN_WARNING  "<4>"  /* warning conditions               */
#define KERN_NOTICE   "<5>"  /* normal but significant condition */
#define KERN_INFO     "<6>"  /* informational                    */
#define KERN_DEBUG    "<7>"  /* debug-level messages             */

So only errors, critical conditions, alerts and emergencies from pppd will
be logged.

The advantages of this are that your log files don't get continually
cluttered with hundreds of informational messages from pppd when you call
in from scripts or a cron job. For example, I use a script that calls my
ISP every 4 hours, or if I am already connected, it just uses the current
connection. Running this 6 times a day (24 hours) adds up after a few
months, and my log files get clogged with megabytes of ppp messages. This
patch eliminates those messages, only temporarily though. This is good,
because certain script files can log or not log informational messages
depending on the command-line arguments they pass on to pppd.

This patch can be used in conjunction with ppp-preup, which can be found
at sunsite or mirrors. ppp-preup adds a /etc/ppp/ip-preup file which can
execute commands before ppp routing changes take place, allowing you to
turn off a loop device before enabling ppp, without a time gap that
neither the loop device or ppp is routed.

USAGE

- Untar pppd-2.2.0f in /usr/src:
cd /usr/src
tar zxvf /path/to/pppd-2.2.0f.tar.gz

- Change to pppd-2.2.0f/pppd:
cd pppd-2.2.0f/pppd

- Apply the patch:
patch -p0 < /path/to/ppp-lessdebug-patch

If no errors or .rej files are generated, the patching was a success. You
can delete *.orig. Now configure, compile and install PPPD as usual
(described in the READMEs).

Most people who know a little C would probably be able to do this on their
own, but might not think to put a command-line argument in, so I am
distributing this patch to save you time. Hope this helps!

regs...

-Toby
 toby@eskimo.com
