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

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

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

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
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.

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

Reply to: