PDA

View Full Version : pid.log: bind:: not found



palkot
10-13-2003, 12:29 PM
I have an HTML embedded perl script on my drivespace at school. I'm using the university's perl interpreter to run the script. Overall, it works fine. Problem is, I can read from files, but I cannot write TO files.. sometimes.

I'm using CGIscriptor (http://fonpc18.hum.uva.nl:8080/) which is a small server application. The running program is called CGIservlet. Basically I need to start the program and it runs the script through the browser. It works pretty well. I'll start the program and it does everything.. I can read from and write to files for about a day or so and then it just stops running for no apparent reason. When I restart the program, it doesn't give me any errors, but it doesn't start back up. When I type the command to stop the program, it says

pid.log: bind:: not found

Which I have determined to mean that the 'bind' command isn't being recognized in the shell, however the bind command is recognized normally at the prompt.

So I look in the 'pid.log' file and there's one line that says

bind: Address already in use at ./CGIservlet.pl line 669.

*I've tried several different ports (sockets?) and they all work for a day or so and then stop.

CGIservlet.pl is the actual program, I think.

line 669 in CGIservlet.pl is

bind(Server, sockaddr_in($port, INNADDR_ANY)) || die "bind: $!";

Here's some pertinent info:

Machine hardware: sun4u
OS version: 5.8
Processor type: sparc
Hardware: SUNW,Ultra-4

Forte Developer 7 is installed, however I don't know if that includes the perl interpreter.

Also, (if you're still reading this you either have a clue as to what I'm talking about or you're curious as to what planet I'm dialing in from, either way, thanks) even when the program appears to have 'stopped', my scripts will continue to run and read from files, they just stop writing TO the files.

I've attached a file that is an example of one of the perl scripts I am using to read/write from/to a file. (it's actual extension is .html, but it wouldn't upload w/ that)

Here (http://unixs.cis.pitt.edu:8333/index.html) (http://unixs.cis.pitt.edu:8333/index.html) is the actual site I am talking about (my band needs a name, so I wrote the program to collect names and allow my bandmates to vote on them. As you'll notice, the page loads fine (that's a script that does everything, very little html), however any function that writes to a file just doesn't work.

If any of this is familiar to you, you have the potential to help me. You can probably tell that this is all self taught and the fact that even part of this works is a small miracle.

1. what does 'bind' actually do?
2. how do I tell what, if any, other applications are using the port/address/socket that I'm trying to use?
3. please tell me if I am an idiot or not, it would really be a load off my back

Thank you thank you thank you if you've even read this far. I know I always have these weird off-the-wall problems that don't make sense. I'm just learning this stuff.

thanks again