From owner-freebsd-isp Mon Sep 30 22:59:17 1996 Return-Path: owner-isp Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA29453 for isp-outgoing; Mon, 30 Sep 1996 22:59:17 -0700 (PDT) Received: from bitbucket.edmweb.com (bitbucket.edmweb.com [204.244.190.9]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id WAA29444 for ; Mon, 30 Sep 1996 22:59:12 -0700 (PDT) Received: (from steve@localhost) by bitbucket.edmweb.com (8.6.12/8.6.12) id WAA00645; Mon, 30 Sep 1996 22:59:12 -0700 Date: Mon, 30 Sep 1996 22:59:06 -0700 (PDT) From: Steve Reid To: freebsd-isp@freebsd.org Subject: logging connection times with pppd Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. -- | ===================================================================:)