Needed: a script that will restart pppd automatically

Needed: a script that will restart pppd automatically

Post by MoJoS » Tue, 22 Aug 1995 04:00:00



Hi, I have a Linux 1.2.3 machine at home that I connect to the Net with
pppd and chat. I am trying to find a script that will check the net
connection every 10 mins or so and reset my ppp connection if something
has gone wrong with it. Does anyone know of a script that does this well.
I have tried to utilise the ip-down script but it doesn't seem to be very
reliable in that if it doesn't connect again on it's first attempt after a
problem, it dies and doesn't try to connect again. I'm sure I am doing
something wrong. If anyone has a bullet-proof method, your help would be
greatly appreciated! Please e-mail me also!

Mojoski

Del Simmons

http://www.mojoski.com/
Check out our WebChat area!

 
 
 

Needed: a script that will restart pppd automatically

Post by sean ut » Tue, 22 Aug 1995 04:00:00



>Hi, I have a Linux 1.2.3 machine at home that I connect to the Net with
>pppd and chat. I am trying to find a script that will check the net
>connection every 10 mins or so and reset my ppp connection if something
>has gone wrong with it. Does anyone know of a script that does this well.
>I have tried to utilise the ip-down script but it doesn't seem to be very
>reliable in that if it doesn't connect again on it's first attempt after a
>problem, it dies and doesn't try to connect again. I'm sure I am doing
>something wrong. If anyone has a bullet-proof method, your help would be
>greatly appreciated! Please e-mail me also!

>Mojoski

I have a simple one that calls my startup script (actually, I went to a 56k
frame relay connection, and don't use PPP anymore for full time).

#!/bin/sh
# Script to check to see if the link is up and restart it if not.
# runs from cron every ten minutes
# Sean Utt Mon May  1 18:16:16 PDT 1995
# change the target to something near you ...
# change the chatter variable too...
# ping -c 1 does one ping only...

Target="199.2.96.37"
Chatter="chatcat"

if test `ping -c 1 ${Target} 2> /dev/null |tail -1 |cut -f1 -d " "|cut -c1-2` =
ro
    then exit 0
else
kill `ps -x | grep ${Chatter} |grep -v grep|cut -c0-6`
sleep 30
echo "pppd has been restarted on `date`"
exec /root/ppp/startup
fi

startup of course calls the chat routine and does all that stuff...
chatcat is the chat script that startup calls, and that is a unique identifier
out of ps that I can use to keep from killing other ppp connections dialed in.
put this in your crontab to run every 15 minutes, and all will be fine.

--
    Autobahn Internet Services Inc.  P.O. Box 1247 Sherwood, OR 97140
     Charting a Course to the Future with WebMaster Sean at the Helm
    Online Catalogs - Dial Up Access - Consulting - Custom Programming
      http://www.Northwest.com/index.html  Call or Fax: 503-774-3352

 
 
 

Needed: a script that will restart pppd automatically

Post by Joe Dydowi » Thu, 24 Aug 1995 04:00:00



>Hi, I have a Linux 1.2.3 machine at home that I connect to the Net with
>pppd and chat. I am trying to find a script that will check the net
>connection every 10 mins or so and reset my ppp connection if something
>has gone wrong with it. Does anyone know of a script that does this well.
>I have tried to utilise the ip-down script but it doesn't seem to be very

diald


NZNET System/Accounts Administrator

DynaSoft Software Systems
http://www.dynasoft.gen.nz/   (NZ Only)

 
 
 

Needed: a script that will restart pppd automatically

Post by Brett McCormi » Tue, 29 Aug 1995 04:00:00


: >Hi, I have a Linux 1.2.3 machine at home that I connect to the Net with
: >pppd and chat. I am trying to find a script that will check the net
: >connection every 10 mins or so and reset my ppp connection if something
: >has gone wrong with it. Does anyone know of a script that does this well.
: >I have tried to utilise the ip-down script but it doesn't seem to be very
: >reliable in that if it doesn't connect again on it's first attempt after a
: >problem, it dies and doesn't try to connect again. I'm sure I am doing
: >something wrong. If anyone has a bullet-proof method, your help would be
: >greatly appreciated! Please e-mail me also!
: >
: >Mojoski
: >

I use the wonders of init to restart my ppp connection..
line in init file:
--
s1:45:respawn:/etc/ppp cua1 38400
--
/etc/ppp:
--
#/bin/sh
/usr/lib/ppp/pppd $1 $2 modem -detach defaultroute connect \
"/usr/lib/ppp/chat -v '' ATZ OK ATDTXXX-XXXX CONNECT '' ogin: <login> assword: <password>"
--

 
 
 

1. PPP:Need getty to restart on broken line automatically

Configuration: Sun workstation ethernet to Portmaster, which dials up remote
Linux box.

Problem: PortMaster will drop line before a disconnect request is sent by the
Sun workstation acting in this case as the PPP Client.  This leaves the PPPD
process running on the Linux machine, acting as the server.  Therefore, the
next time the PortMaster tries calling the Linux machine, it cant.

Question: Is there a way for the PPPD process to automatically detect a broken
phone line, turn itself off, and re-enable the getty process so that the
connection can be re-established.

Comments:  All of this works properly if the PPP Client has a normal
termination, for if I call up the Linux box using Chameleon as a PPP Client
running on a PC, the Linux machine resets itself for the next call when
Chameleon exits. I conclude that Chameleon as part of its termination, sends a
final ppp packet to the Linux host to terminate.  The final configuration
however will be the described PortMaster.

Boundary Conditions:  I can change the Linux end, but not the PortMaster side.

Thanks in advance
Gerry Jensen
GE Medical Systems

2. HELP: Pnews/inews problem

3. I need a shell script which will automatically update a file.

4. Micropolis 4345SS booting problems

5. Need Script to automatically generate email to Webmaster when page error occurs

6. Athlon kernels

7. Need script to restart ppp after lost LCP packets

8. Where is NIC setting stored?

9. Automatically restarting XDM Login

10. How to automatically restart stopped daemons

11. System restart again and again automatically

12. How to automatically restart a process....

13. System restart again and again automatically