[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: net-acct and a ppp dial-in server



On Mon, 19 May 1997, John Foster wrote:

> I tried this script from mgetty instaed of just the call 
> to pppd:
> 
> #!/bin/bash
> /usr/sbin/pppd auth -chap +pap login defaultroute proxyarp
> whereisuser=`w | grep $1 | tr -s ' ' | cut -d ' ' -f 2 `
> addressuser=`grep $whereisuser /etc/hosts | expand | tr -s ' ' | \ 
> 	cut -d ' ' -f 1`
> echo $1 > /var/run/$addressuser    
> 
> and the clients can dial-in OK, but the latter part (from wherisuser
> on) doesn't get run until the client logs out (ie after pppd dies), so
> the greps fail and no file is written. Before the pppd there is no way
> of telling who the user is ( Just AutoPPP!).

yes, that is normal behaviour - pppd is being run in the foreground
(with control of the tty) in this situation, so the remainder of the
script doesn't execute until pppd exits.

That's how it's supposed to be, so don't waste any time trying to get pppd
to run in the background.

One of pppd's features is the ability to run a script when a link is
established and another when it is terminated. These are the 'ip-up' and
'ip-down' scripts, and they reside in the /etc/ppp directory.

you need to edit your /etc/ppp/ip-up and /etc/ppp/ip-down scripts. the
documentation for net-acct tells how to do it for slip logins...it's not
very difficult to apply the same principles for ppp.

try adding something like:

    /usr/bin/whoami >/var/run/$5

to /etc/ppp/ip-up, and add:

    rm /var/run/$5

to /etc/ppp/ip-down

this is the bare minimum you need to get it working.  

NOTE: these changes are untested....however, from my understanding of
the docs, they should work.


craig

--
craig sanders
networking consultant                  Available for casual or contract
temporary autonomous zone              system administration tasks.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: