[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

perl script run by inetd ??



local $EOL = "\015\012";
        print "Welcome ; type help for command list.$EOL";
        print "Command?$EOL";
        while (<STDIN>) {
        chop;
        print;
       }

greet all,
the above perl snipet is configured to be run by inetd at port 9100. If I
do a 'telnet localhost(or its IP) 9100. I will enter a weird mode: I can
enter anything, without any repsonse. Actually I can't terminate the input
mode by ctrl-D or whatever but 'kill -TERM $PID'. 

-------------------------------------------------------
Trying 127.0.0.1...
Connected to localhost.cc.emory.edu.
Escape character is '^]'.

this
that
whatever
Terminated.
------------------------------------------------------

If I comment out the while<STDIN> loop, I can get the printout from the
service, like "welcome, blah, blah", so I know the inetd is configured
alright and is listening to this port.

The script can be run at command line without any problem. Any clue?

Actually, if I put /bin/cat as one of the inetd service, it will terminate
the connection with something like "(none) --help".  When you type cat at
comand line, it will repeats anyline you input. This really confused me. I
thought server script run by inetd should read/write to STDIN/STDOUT.

Hope someone can give me a pointer or two.

 YU, Zhongbin                  			In Nature I believe:-)
------------------------------------------------------------------------
M.S. in CIS (expected)		| Systems Engineer, Premiere Tech., Inc.
voice/fax: 404-251-9066 (H)	|	 jerry_yu@bigfoot.com
www.bigfoot.com/~jerry_yu	|	    404-262-8544 (O)


Reply to: