View Full Version : DOD with Linux Redhat

04-08-2003, 11:47 PM
As I have mentioned on another occasion, I have installed and look after (at no cost) a Linux RedHat 7.0 server as a file server and internet gateway for a small school. I have set up dial-on -demand as in these instructions:


I have set up an external 56kbps modem. One of the ways teachers can control student access to the internet is by turning this modem off. If this is done while the modem is still on-line, a complete restart of the PC is required to get dod to work again. You might think a restart of ppp would do it - but no.

Does anyone have any ideas of how to get around this. Waiting for the modem to go off line is a pain. I have the timeout set to 3 minutes from memory. However the Windows workstations broadcast packets to the LAN that extends this period or forces the modem to dial out again if you are not quick enough.

Graham L
05-08-2003, 05:13 PM
Turning the modem off will leave it still "owned" by the PPP which has it. No other PPP process can have it until the lockfile has been zapped.

Any leftover lock files should be cleaned up at the next boot, so that's why you have been rebooting. The fix?

Have a look at /var/lock while it's running, to find the appropriate name. Then make a script (which will need to be run with root privilege) like#! /bin/sh
rm -f /var/lock/modemlock_file_name You could "chmod +s" it (frowned on as a secuirity risk ... but it won't be too dangerous ... :D)

05-08-2003, 08:45 PM
Thanks Graham - I will give it a go soon.


09-08-2003, 07:29 PM
I have found there is a lock file called LCK..ttyS0 which does get deleted automatically if the modem is powered down with the switch. (So unfortunately that blows that theory it seems).

I tested the system and found that in several goes, re-dialling was successful. However I know from experience that redials do not always occur and sometimes a reboot seems to be necessary.

Any other ideas as to what could stop redials some of the time?


Graham L
10-08-2003, 03:25 PM
It should "never" need a reboot, anyway. :D Have a look at /etc/inittab . I'm not sure what programme is used for the dialout terminal line, but make sure that it is like the ordinary (virtual) pty lines and restarts when it ends. The magic command init q might be the next thing to try. (It was a lovely theory though ... :D).