ncurses problem in telnet/serial console.

Omanakuttan omanakuttan at tataelxsi.co.in
Tue Jul 8 23:59:44 EST 2003


Hi,
We have developed a Brouter on mpc8260 running linux with ncurses CUI
for administrative tasks. ncurses
Requirement is that when the user telnet to the router or connect to the
serial port, the CUI should come up, and the usual telnet login prompt
should not come up.
libncurses.so.5 is the libray we use.
What I did is to modify the /etc/xinetd.d/telnet to our program. Our
telnet file now look like

[root at pandatel12 ~]# cat /mnt/bet_rd/etc/xinetd.d/telnet
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
         flags           = REUSE
         socket_type     = stream
         wait            = no
         user            = root
         #server         = /usr/sbin/in.telnetd
         server          = /bin/mdi
         log_on_failure  += USERID
         disable         = no
}
[root at pandatel12 ~]#
When we telnet to the port 23, the error we get it

[root at pandatel12 ~]# telnet 10.1.28.44
Trying 10.1.28.44...
Connected to 10.1.28.44 (10.1.28.44).
Escape character is '^]'.
Error opening terminal: vt100.
Connection closed by foreign host.
[root at pandatel12 ~]#

The code is

[root at pandatel12 ~/test]# cat ncursestest.c
#include <ncurses.h>
int main()
{
         initscr(); /* Start curses mode */
         printw("Hello World !!!"); /* Print Hello World */
         refresh(); /* Print it on to the real screen */
         getch(); /* Wait for user input */
         getch(); /* Wait for user input */
         getch(); /* Wait for user input */
         endwin(); /* End curses mode */
         return 0;
}
[root at pandatel12 ~/test]# gcc -o mdi -lncurses ncursestest.c
[root at pandatel12 ~/test]#


At the same time, if I login to the board (after changing telnet entry
to in.telnetd) and run the application, it works fine.
TERMINFO settings are in /etc/profile.

[root at pandatel12 ~]# cat /mnt/bet_rd/etc/profile
#!/bin/sh
export TERMINFO=/etc/terminfo

What can be the resaon for this error?

For serial I modified the /etc/inittab, but getting the same error. If I
can solve the first one, this can also be solved in similar lines I believe.

Thanks for your time,
Om.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list