![]() |
s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
13. Fifth Example: XmDipmon
XmDipmon is a nifty little application that displays a button showing the status of an Internet connection. It flashes and beeps when the connection is broken, as is all too often the case in on rural telephone systems. Unfortunately, XmDipmon works only with dip, making it useless for those people, the majority, who use chat to connect. Building XmDipmon is not a problem. XmDipmon links to the Motif libraries, but it builds and works fine with Lesstif. The challenge is to alter the package to work when using chat. This involves actually tinkering with the source code, and necessarily requires some programming knowledge.
Using the -pidfile option, the program can be directed to check for a different file upon startup, one that exists only during a successful chat login. The obvious candidate is the modem lock file. We could therefore try invoking the program with xmdipmon -pidfile /var/lock/LCK..ttyS3 (this assumes that the modem is on com port #4, ttyS3). This only solves part of the problem, however. The program continually monitors the dip daemon, and we need to change this so it instead polls a process associated with chat or ppp. There is only a single source file, and fortunately it is
well-commented. Scanning the
We are hot on the trail now. Tracing into the body of the function...
The culprit is line 2383:
This checks whether the dip daemon process is running . So, how can we change this to monitor the pppd daemon instead? Looking at the pppd manpage:
Change line 2383 in
Rebuild the revised package. No problems with the build. Now test it
with the new command line argument. It works like a charm. The little
blue button indicates when a
XmDipmon can be downloaded from Ripley Linux Tools.
Next Previous Contents |