Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help, I need to get PPP to automaticaly redial . . .

31 views
Skip to first unread message

Dick Merryman

unread,
Nov 15, 1995, 3:00:00 AM11/15/95
to Edmond E. Shwayri, di...@wormhole.com
Ed-

Hi. I think I have the same need as you and I solved it very easily.
I also have a 24/7 connection that drops when I'm not around. I use cron
to fire off a script every five minutes that tests if the connection is
still up. If so, the script terminates. If not, it starts pppd again,
re-establishing my connection.

You could change the crontab entry to any frequency that you needed. 5
minutes was good for me. An added bonus is that it will also recover from
a power failure reboot.

My crontab entry looks like this:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /root/connect > /dev/null

The name of my reconnect script is "connect" and I throw the output away
when it runs.

If you need help with the script, I'll share mine with you. Just be sure
to test for the existance of /var/run/ppp0.pid to sense if pppd is still up
or not.

Good luck,


-Dick-

nc...@pcd.net

unread,
Nov 16, 1995, 3:00:00 AM11/16/95
to
Dick Merryman (di...@wormhole.com) wrote:
: Ed-

: Hi. I think I have the same need as you and I solved it very easily.
: I also have a 24/7 connection that drops when I'm not around. I use cron
: to fire off a script every five minutes that tests if the connection is
: still up. If so, the script terminates. If not, it starts pppd again,
: re-establishing my connection.

There is a simpler and more efficient way of doing this. What I did was
to create a 'script' that sets up my ppp for me. Be sure that the script
has the "#! /bin/sh" at the top, and add "-detatch" to your pppd command line
in the script. Now go into your /etc/inittab and add a line for it with the
"RESPAWN" option activated. My entry looks Like this:

# Dialup Internet connection
d1:3456:respawn:/root/ppp.sh

Now, this will do 2 things for your situation.
A) It'll reduce your load by not checking every 5 minutes
B) Will reconnect considerably quicker, my reconnect takes 28 seconds.

One thing you will need to add the the end of your script is a "sleep" command,
my script has a "sleep 5" so that it waits 5 seconds before exiting the script...
Other wise you have pppd being launched again before the old pppd has actually
exited and it does cause errors. If you have any questions or problems
you can e-mail me here, or ro...@biohazard.com (My 24/7 inittab'd ppp =)

This will also get run at start up and takes an extremely small period of time
to start up.

Chad

0 new messages