dropping the modem connection and ttymon/login question

dropping the modem connection and ttymon/login question

Post by Adam Ste » Wed, 23 Feb 2000 04:00:00



I'm trying to write a dialback program for Solaris (working on v2.6).
With ttymon, it's easy to have it call my program instead of the
default /bin/login.

The one problem I'm encountering is trying to drop the modem
connection.  My program ends after I do this.  I've tried ignoring
all signals (with sigignore()) figuring that I might be getting HUP
(first I tried just ignoring HUP, but that didn't do anything).
Anybody know why my program is terminating when I disconnect the modem
line?  And more importantly, how to prevent it?

Thanks for any information.
--

Disclaimer: Any/All views expressed
here have been proved to be my own.   [http://www.csh.rit.edu/~adam/]

 
 
 

dropping the modem connection and ttymon/login question

Post by Greg Andre » Thu, 24 Feb 2000 04:00:00



>I'm trying to write a dialback program for Solaris (working on v2.6).
>With ttymon, it's easy to have it call my program instead of the
>default /bin/login.

>The one problem I'm encountering is trying to drop the modem
>connection.  My program ends after I do this.  I've tried ignoring
>all signals (with sigignore()) figuring that I might be getting HUP
>(first I tried just ignoring HUP, but that didn't do anything).
>Anybody know why my program is terminating when I disconnect the modem
>line?  And more importantly, how to prevent it?

The most obvious way to prevent it is to tell the modem to
not drop the DCD signal when it disconnects.  How to do this
depends on the features of your modem.  Some can be configured
to enter command mode when you drop the DTR signal, and some
when you send a break signal.

If you can achieve this, you can send a command to make the modem
hold DCD on all the time, hang up the phone line, and dial out
while remaining in command mode.  Then when the modem says a
connection was made, you can re-program the DCD behavior and
tell the modem to go back on-line.

Might be easier to have ttymon invoke a program that sends a signal
to another program that does the calling back.  Then the original
program can be killed off when the modem hangs up without preventing
the callback.

  -Greg
--

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 
 
 

dropping the modem connection and ttymon/login question

Post by Philip Bro » Thu, 24 Feb 2000 04:00:00



Quote:>....
>The one problem I'm encountering is trying to drop the modem
>connection.  My program ends after I do this.  I've tried ignoring
>all signals (with sigignore()) figuring that I might be getting HUP
>(first I tried just ignoring HUP, but that didn't do anything).
>Anybody know why my program is terminating when I disconnect the modem
>line?  And more importantly, how to prevent it?

there's a complicated solution, and a simple solution.
well, there's atleast two solutions :-)
one way would be to simply fork your program before disconnecting the
modem.
Then the child re-opens a modemline.

From a security standpoint, it is cleaner to open a separate modem for
outgoing, anyway.

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

The word of the day is mispergitude

 
 
 

dropping the modem connection and ttymon/login question

Post by Andrew Gabri » Thu, 24 Feb 2000 04:00:00




Quote:

> The most obvious way to prevent it is to tell the modem to
> not drop the DCD signal when it disconnects.

... or I think you can effectively tell the driver to ignore the
DCD drop by setting CLOCAL (certainly it allows you to issue commands
to the modem whilst DCD is dropped). If this works, I suggest you do it
only when you are expecting a line drop, so if it drops at some other
time, things do get killed off correctly.

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

dropping the modem connection and ttymon/login question

Post by Adam Ste » Fri, 25 Feb 2000 04:00:00




Quote:> there's a complicated solution, and a simple solution.
> well, there's atleast two solutions :-)
> one way would be to simply fork your program before disconnecting the
> modem.
> Then the child re-opens a modemline.

I tried forking a child, but it seemed to get killed as well.

Adam

 
 
 

1. login sessions remain if the ppp connection is dropped

Hello
  I have a problem with ppp connections to my machine. We are using
a cisco 2509 router/access server to give dialin ppp lines to our
users. Our users mainly use win95 to connect. Many users then use
win95's telnet prog to telnet to our main system (pearl.sums.ac.ir)
which is running linux 2.0.30 on a Pentium/133. If the ppp connection
is dropped before the users log out from each telnet session, they
remain logged in to pearl although the ppp connection is lost. I have
tried TMOUT in the sh profile, but this only logs them out if they are
in the shell prompt. If they are in eg pine or vi I'll have to kill them
manually.
Can anyone help?

thanks

-----

Shiraz University of Medical Sciences, Shiraz, Iran

2. question about the FAQ

3. A few questions about modems, ttymon and ppp

4. asus a1356d with sis630 + xfree =HORROR! (AUDIT and Xlib problems)

5. login sessions remain if the ppp connection is dropped

6. libc: setlocale: LC_xxxx: LANG= syntax error in /etc/default/lang

7. A few questions about modems, ttymon and ppp

8. Setup Linux on Syquest 270mb?

9. ttymon fails to drop DTR?

10. ttymon error:ttymon cannot allocate controlling tty on /dev/console

11. Modem Drops My Connection

12. Detecting modem connection dropped?

13. Dial in US Robotics modem drops connection. Help!