views:

999

answers:

3

I'm running pylons and I did this: paster server development.ini It's running on :5000

But when I try to run the command again: paster serve development.ini

I get this message: socket.error: [Errno 98] Address already in use

Any ideas?

+2  A: 

Normally that means it's still running, but that should only happen if it's in daemon mode. After you started it, do you get a command prompt, or do you have to stop it with Ctrl-C?

If you get a command prompt back it's deamon mode and you have to stop it with

paster server development.ini stop

If you have stopped it with Ctrl-C (and not Ctrl-Z of course), I have no idea.

Lennart Regebro
+2  A: 

As I understand your question, you start some application to listen on port 5000. Then without stopping it (?), you try to start another instance to listen on het same port? If so, you won't succeed.

You can always check what application is listening on what port number by using netstat (for both Windows and UNIX-like systems, I have no experience with others).

Grzegorz Oledzki
+1 for the the info on netstat.
Tom Willis
A: 

This has also happened to me when the server died unexpectedly, and didn't close it's socket's properly. Essentially, the socket is still listed as open with the operating system, even though the process has died. I've found if I wait for 30-60 seconds, the OS will realize the associated process has died, and cleanup the sockets automatically.

Chris S