On Tue, 17 Aug 1999, Brad wrote: : On Tue, 17 Aug 1999, Nathan E Norman wrote: : : > I'm trying to write a daemon (in perl) : : Isn't Perl wonderful? At the moment, i'm working on a CD ripper using : cd-diskid, perl-tk, cdparanoia, id3, and bladeenc and CDDB.pm. It actually : works pretty well!
I'm really starting to appreciate it! So, when can we get a copy of your CD ripper? :) : > that monitors the "health" of the next hop on an ethernet port (think : > DSL or cable connection), and dials a provider when the connection : > goes down. To do this, I need to invoke pppd from my prgram ... pppd : > forks and disconnects to do this, so I have no easy way to determine : > WHEN the link is up (I delete the eth default route and add a ppp0 : > default route only once the dial-link is up, or that's the plan). : > Right now I have to use sleep and that's plain ugly (and doesn't : > always work when the dial server is cranky). : : You're invoking pppd directly? Why not use pon or wvdial? (just curious) I was using pon originally, and that's when the trouble started. I don't see a reason to not use pon, unless I decide to strive for distribution independence (and since I use only Debian that's not a big issue right now). : Are you going to continue monitoring the health, and undial/restore eth0 : when it heals? That's the plan, though I'm hoping to achieve some flexibility by having my program handle the routing - I'd like to be able to bring up the ethernet route, and if it fails "soon" (where "soon" is a user defined parameter) the ppp route is simply restored without having to redial. : > So, how to discover that pppd is up and running on a link? Perhaps I'm : > being incredibly dense here (I'm sure I am) but I don't see how to do it : : Put a script in /etc/ppp/ip-up.d to send SIGUSR1 to your program (create a : pid file in /var/run so the script can find you). This way, your program : just waits til it gets SIGUSR1 before tearing down the eth0 route. Duh! Thanks for the enlightenment ... cable modems have spoiled me. I believe you've supplied me with the missing link :) (This list is very cool, btw, and I've been here for three years now ..) -- Nathan Norman MidcoNet 410 South Phillips Avenue Sioux Falls, SD mailto:[EMAIL PROTECTED] http://www.midco.net finger [EMAIL PROTECTED] for PGP Key: (0xA33B86E9)