Sidebar: PPP Connection/Monitoring Options
Demand dialing is not important to us because we have a local phone number and an unlimited account. It can be important if you have to dial long distance or if you are charged by the hour. Eric Schenk has written a package called DIALD, which is available via anonymous ftp from sunsite.unc.edu. Although I haven't installed this package, it has received high marks in the newsgroup comp.os.linux.networking.
Our setup is quite a bit simpler. At the beginning of a working day the following jobs are run:
start-monitor (Listings 1 and 2) - 7am Monday-Friday
check (Listing 5) - Invoked if the modem line isn't active
If anything happens to the modem, start-monitor will restart the PPP connection. telnet users will have to reconnect, but WWW users will only notice a delay in receiving their page.
At the end of a working day, the PPP connection is shut down. This is a courtesy to our ISP, which typically receives the most modem usage in the evening and on weekends.
stop-monitor (Listing 3) - 6:30pm Monday-Friday
stop-PPP (Listing 4) - 6:40pm Monday-Friday
We do need to kill the monitoring process before we can shut down the PPP connection. Otherwise, the PPP monitor would just reestablish the Internet connection. I was torn between letting the PPP connection die via ISP timeout and explicitly shutting it down. In this case, explicit shutdown hasn't caused any complaints (e.g., from users cut off in the middle of a telnet/WWW session). You might want to think about not running stop-ppp if you have a lot of end-of-day usage.
Listing 7 contains the root crontab entries which run the scripts/monitor daemon. Listings 1-5 reside in /usr/lib/ppp.
|