Linux PPP protocol development
 help / color / mirror / Atom feed
* hanging tcsetattr call
@ 2008-03-05 22:19 bfc
  2008-03-05 22:31 ` Bill Unruh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bfc @ 2008-03-05 22:19 UTC (permalink / raw)
  To: linux-ppp


It seems when my chat script times out, i'll get an "alarm" notification from
chat, then chat exits, and
pppd hangs for a while on a tcsetattr() call -- it's trying to restore the
terminal characteristics of
our serial port.  

Eventually it syslogs:
Mar  5 17:09:25 box pppd[21132]: tcsetattr: Interrupted system call (line
1001)

Evidentally the pppd can no longer use the device, perhaps it's been reset
from having an session attempted
but not succeeding?  Anyone else ever see this problem?

Should there be any signal flow that causes this to go correctly, e.g. a
SIGCHLD going to the pppd?
Or does pppd just see a non-zero exit value from chat, and should gracefully
shut itself down?

Thanks!
-- 
View this message in context: http://www.nabble.com/hanging-tcsetattr-call-tp15861511p15861511.html
Sent from the linux-ppp mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hanging tcsetattr call
  2008-03-05 22:19 hanging tcsetattr call bfc
@ 2008-03-05 22:31 ` Bill Unruh
  2008-03-06  1:43 ` bfc
  2008-03-06  1:58 ` Bill Unruh
  2 siblings, 0 replies; 4+ messages in thread
From: Bill Unruh @ 2008-03-05 22:31 UTC (permalink / raw)
  To: linux-ppp

On Wed, 5 Mar 2008, bfc wrote:

>
> It seems when my chat script times out, i'll get an "alarm" notification from
> chat, then chat exits, and
> pppd hangs for a while on a tcsetattr() call -- it's trying to restore the
> terminal characteristics of
> our serial port.

Tell us how you set up yoru chat script. It should not be terminating while
pppd is running. It should start pppd when it successfully opens the port. 
So giving your details would be helpful.


>
> Eventually it syslogs:
> Mar  5 17:09:25 box pppd[21132]: tcsetattr: Interrupted system call (line
> 1001)
>
> Evidentally the pppd can no longer use the device, perhaps it's been reset
> from having an session attempted
> but not succeeding?  Anyone else ever see this problem?
>
> Should there be any signal flow that causes this to go correctly, e.g. a
> SIGCHLD going to the pppd?
> Or does pppd just see a non-zero exit value from chat, and should gracefully
> shut itself down?

???? chat runs. If it successfully connects it starts up pppd an exits.


>
> Thanks!
>

-- 
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@physics.ubc.ca
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hanging tcsetattr call
  2008-03-05 22:19 hanging tcsetattr call bfc
  2008-03-05 22:31 ` Bill Unruh
@ 2008-03-06  1:43 ` bfc
  2008-03-06  1:58 ` Bill Unruh
  2 siblings, 0 replies; 4+ messages in thread
From: bfc @ 2008-03-06  1:43 UTC (permalink / raw)
  To: linux-ppp


Most of the time things work OK -- maybe the chat script needs work, may
there's a resource issue on the
far end, but I think it'd be interesting to know what the error case should
look like.  If you reach the end of
the time specified by a TIMEOUT chat line (or the default TIMEOUT), then I
should think chat would exit
with a non-zero, and pppd should promptly exit with an error, not hang on
tcsetattr().  BTW, I'm not using
persist or any other option to keep things going.

My pppd option file looks something like:

noauth
debug
name foobar.com
/dev/ttyS0 115200 crtscts
connect '/usr/sbin/chat -f /var/opt/foobar/chat-file

..and the chat-file:

ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "BUSY"
'' ATH
OK AT&F0
OK ATDT5555
TIMEOUT 120
CONNECT \d\c


-- 
View this message in context: http://www.nabble.com/hanging-tcsetattr-call-tp15861511p15864699.html
Sent from the linux-ppp mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: hanging tcsetattr call
  2008-03-05 22:19 hanging tcsetattr call bfc
  2008-03-05 22:31 ` Bill Unruh
  2008-03-06  1:43 ` bfc
@ 2008-03-06  1:58 ` Bill Unruh
  2 siblings, 0 replies; 4+ messages in thread
From: Bill Unruh @ 2008-03-06  1:58 UTC (permalink / raw)
  To: linux-ppp

On Wed, 5 Mar 2008, bfc wrote:

>
> Most of the time things work OK -- maybe the chat script needs work, may
> there's a resource issue on the
> far end, but I think it'd be interesting to know what the error case should
> look like.  If you reach the end of
> the time specified by a TIMEOUT chat line (or the default TIMEOUT), then I
> should think chat would exit
> with a non-zero, and pppd should promptly exit with an error, not hang on
> tcsetattr().  BTW, I'm not using

PPP always tries to clean up after itself. It does not simply die. 
Thus you seem to be having some serial port problems.

Why don't you put in a TIMEOut of 2 and put garbage in that next line to
see if it is the timout that is causing the trouble
TIMEOUT 2
y79876y '\d\c'



> persist or any other option to keep things going.
>
> My pppd option file looks something like:

Something like??? With computers
Assuming your "somthing like" was a misstatement:

>
> noauth
> debug
> name foobar.com
> /dev/ttyS0 115200 crtscts
> connect '/usr/sbin/chat -f /var/opt/foobar/chat-file

You are missing a terminating end single quote.


>
> ..and the chat-file:
>
> ABORT "NO CARRIER"
> ABORT "NO DIALTONE"
> ABORT "ERROR"
> ABORT "BUSY"
> '' ATH
> OK AT&F0
> OK ATDT5555
> TIMEOUT 120
> CONNECT \d\c

The \d\c should be protected by single quotes
CONNECT '\d\c'

Also run chat with -v option, and put
local2.*			/var/log/daemonlog
and show us the output in /var/log/daemonlog
so we can see what chat is trying to do.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-06  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-05 22:19 hanging tcsetattr call bfc
2008-03-05 22:31 ` Bill Unruh
2008-03-06  1:43 ` bfc
2008-03-06  1:58 ` Bill Unruh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox