Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 1996 22:59:06 -0700 (PDT)
From:      Steve Reid <steve@edmweb.com>
To:        freebsd-isp@freebsd.org
Subject:   logging connection times with pppd
Message-ID:  <Pine.BSF.3.91.960930223102.621A-100000@bitbucket.edmweb.com>

next in thread | raw e-mail | index | archive | help
I don't know if this has been mentioned before, so I'm mentioning it now.

The pppd in -STABLE (and probably 2.1.5-RELEASE) is able to keep track of
connection time by syslogging how many seconds it's been running. I would
guess that this is to keep track of how much time each user is spending
online, but it is NOT reliable if you're running pppd from init via an
entry in /etc/gettytab. 

The problem is, it's logging how long pppd has been running, not how long 
the connection has been up. If pppd is run from init then it could be 
running for hours before it receives a connection.

If you need to keep track of how much time each user is spending online,
I'm fairly certain that this very small change (add one line) should be
sufficient: 

*** /usr/src/usr.sbin/pppd/main.c       Sat Sep 21 20:04:10 1996
--- pppd/main.c Mon Sep 30 22:28:36 1996
***************
*** 482,489 ****
--- 482,490 ----
      /*
       * Block all signals, start opening the connection, and  wait for
       * incoming signals (reply, timeout, etc.).
       */
+     time(&t1);
      syslog(LOG_NOTICE, "Connect: %s <--> %s", ifname, devnam);
      sigprocmask(SIG_BLOCK, &mask, NULL); /* Block signals now */
      lcp_lowerup(0);           /* XXX Well, sort of... */
      lcp_open(0);              /* Start protocol */


If there's a problem with this, or a better way of doing it, please let me
know. I have NOT tested this change yet. It's a very simple change, so I
don't expect any problems with it. 


=====================================================================
| Steve Reid - SysAdmin & Pres, EDM Web (http://www.edmweb.com/)    |
| Email: steve@edmweb.com   Home Page: http://www.edmweb.com/steve/ |
| PGP (2048/9F317269) Fingerprint: 11C89D1CD67287E68C09EC52443F8830 |
|          -- Disclaimer: JMHO, YMMV, TANSTAAFL, IANAL. --          |
===================================================================:)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960930223102.621A-100000>