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

Re: New handling of scripts external to PPPD (ie ip-up, ip-down)



On Mon, 16 Mar 1998, Adam Heath wrote:

> I have never liked the idea of having to edit either ip-up, or ip-down each
> time I want to add a script into the ppp chain.  This is also hard for
> separate packages to do automatically, without errors.
> 
> So here it comes.  Sit down for this one.
> 
> On my system there is *NO* ip-up, or ip-down.  Pppd shells out to
> /etc/ppp/ppp-functions, with the first parameter being a runlevel, and the
> rest the normal parameters passed to ip-up.  Then, ppp-functions sets up some
> variables, and runs "/etc/ppp/rc <runlevel>."  Rc is similiar to the rc that
> init uses, in that there are kill scripts and start scripts for each level.
> 
> Also, pppd waits until the external script finishes, so make sure that all
> programs are either short in duration, or fork into the background.
> 
> I am thinking of more places to add runlevels.  Currently, I am trying to
> eliminate the connect option from pppd's option files.  Ppp-functions would be
> called like this: "/etc/ppp/ppp-functions dial <hostname> <username> <ip-up
> parms>," with stdin, stdout, and stderr redirected to the serial port.
> Ppp-functions could then use whatever means nescessary to dial.  This would
> allow for dialing several numbers in round-robin fashion, better redial
> capabilities, enhanced logging, etc.
> 
> 
> 
> Hints for the debian developer(don't do this yet, as it is not official)
> 
> If a package wants to be run when pppd is on, then include a file
> "/etc/ppp/scripts.d/<packagename>."  In the postinst, run the command
> ppp-update.d.
> 
> 
> runlevel				directory		old method
> 					(relative to /etc/ppp/)
> --------------------------------------------------------
> init(just before modem init)		init.d
> cnct(modem finished connecting	cnct.d
> 	but before ip-layer
> 	starts)
> online(ip-layer is up)		online.d		ip-up
> offline(ip-layer is down)		offline.d		ip-down
> discnct(modem is disconnected)	discnct.d
> idle(pppd is in the holdtime)		idle.d
> 
> ppp-update.d defaults to online.d/S20 and offline.d/K20.
> 
> 
> 

Success!  I now have no need of a connect option inside of pppd.  Currently,
pppd calls /etc/ppp-functions like this: 
"/etc/ppp/ppp-functions[8360] /dev/ttyS1 862-4141 michnet
adam.heath@voyager.net"

ppp-functions then uses a new runlevel, dial(dial.d) to dial out on the modem.
Currently, a script, connector, build a connect script, and executes chat.
Multiple phone numbers are supported, but currently they are hard-coded into
the script.  Redial takes place *outside* of pppd, so more sophisticated
redial techniques can be used.

I connect to the internet for this session with the "connector" portion
commented out in pppd's source.  It is only running /etc/ppp/ppp-functions.

Adam



--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: