Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Terminal and process hang upon fork and setsid()

Status
Not open for further replies.

zaphbrox

Technical User
Sep 29, 2000
5
0
0
US
Hi,

I have a perl script (on AIX433) from which I first fork out a process and then consequently setsid() it. After forking, the main perl script keeps running, checking the log written to by the forked out process, and taking actions based on it. The forked out process is a server process that is supposed to listen on a specified port, and act on client requests on that port.

Now, at times, I have a situation where the terminal where the script is running just hangs, and so does the forked out process. No amount of interrupts or kill -9 from other terminals bring this terminal back to life, or get the processes responding again. More surprisingly, a netstat check on the port where the *.LISTEN from the server process is to be listening doesn't seem to be showing any process occupying this port, eventhough a ps check shows the server process to be running! This behaviour recurs entirely at random!

Any clues on what is going on here? Could this be happening because of some system limitation on the AIX box, such as load on the machine, max number of open filehandles etc? What is the equivalent of sysinfo for AIX, if I wanted to check? Could it be due to the telnet client used to create the terminals and connect to the server?

Thanks in advance.

regards,
BB.
 
BB,

Hi. Interesting problem - is your forked process hanging in the bind call?

Oh -- and have you tried the Perl forum here at Tek-Tips? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top