-----BEGIN PGP SIGNED MESSAGE----- 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! > 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) Are you going to continue monitoring the health, and undial/restore eth0 when it heals? > 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. - -- finger for PGP public key. -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia Charset: noconv iQCVAwUBN7j9C77M/9WKZLW5AQGoLgP/T/6nccjknF+EsLUeTXOnkR6juEhLjgPb TjWVGtZbxtKnRUB+EaNdf3/Z+HvU5uT7rghkqZyu9Is0RPRKMtQBQ1nrTmXHTphe 8OaHI8l4gzW2BjMtkAE1A1DgVzHyaPbGBrSjkdv3tvT7KSRxt0AhF9U3WDc0cXVM RpkyW+mnuv8= =/69Y -----END PGP SIGNATURE-----