Oct 7 16:39:10 myrouter2 diald[538]: running '/usr/sbin/chat -v -f /etc/chatscripts/provider'
Oct 7 16:39:10 myrouter2 chat[556]: Can't get terminal parameters: Invalid argument
Oct 7 16:39:10 myrouter2 diald[538]: SIGCHLD[4]: pid 555 dial, status 512
Oct 7 16:39:10 myrouter2 diald[538]: Connect script failed.
strace shows chat dying when it is unable to open STDIN (file descriptor zero):
556 <chat> 16:39:10 ioctl(0, TCGETS, 0xbffffcf8) = -1 EINVAL (Invalid argument)
556 <chat> 16:39:10 send(2, "<147>Oct 7 16:39:10 chat[556 <chat>]: "..., 80, 0) = 80
556 <chat> 16:39:10 sigaction(SIGPIPE, {SIG_DFL}, NULL) = 0
556 <chat> 16:39:10 _exit(2) = ?
It seems diald is inadvertently closing the modem fd in run_shell before it starts chat. Function run_shell closes closes file descriptors 0, 1 and 2 (STDIN, STDOUT and STDERR) and then creates new file descriptors for STDIN and STDOUT pointing to the modem.
The assumption appears to be that the modem fd will never be less than 3.
Unfortunately, this appears not to be the case.
strace shows diald returning a file descriptor of 2 for the modem when ethertap is loaded:
538 <diald> 16:39:09 open("/dev/ttyS0", O_RDWR|O_NONBLOCK) = 2
- To unsubscribe from this list: send the line "unsubscribe linux-diald" in the body of a message to [EMAIL PROTECTED]
