Cannot restart a server

Requests for assistance and other HOWTOs.

Moderator: Board moderators

User avatar
Azriel
Regular
Posts: 85
Joined: Thu May 13, 2004 7:33 am

Cannot restart a server

Post by Azriel »

Here is my problem : when i start a server on my machine, and when it crashes, i can't start again the server : it says :

error on setsockopt REUSEADDR: Invalid argument
error on setsockopt REUSEADDR
error on bind command: Address already in use
error on bind command

After, say 10 minutes, i can restart the server. Does anyone know how to avoid this ?
Leaf
Forum Aficionado
Posts: 1994
Joined: Tue Apr 29, 2003 5:55 pm
Location: Minnesota, USA
Contact:

Post by Leaf »

Is the server running on Windows?

What about shutting down the process with the task manager window?


If the server is running on Linux..

1.) From a shell prompt type: ps aux | grep cross

2.) Look at the output for the crossfire process. Example:

504 16142 0.0 0.0 4096 920 pts/1 S Jan12 .crossloop

3.) See the second column? In this case, it's 16142 which is the process ID

4.) Use this command: kill 16142 (basically, kill <process_id>)

5.) Check again to make sure it died nicely, using: ps aux | grep cross

6.) If it's no longer listed, the server has been successfully killed
6a.) If the process is still listed, you may have to use this command: kill -9 <process_id>

This is just one way to stop the server under Linux. :wink:
User avatar
Azriel
Regular
Posts: 85
Joined: Thu May 13, 2004 7:33 am

Post by Azriel »

It does'nt work : the only process with cross is "grep cross". It seems everything about crossfire died at the crash, so there is nothing to kill...
Leaf
Forum Aficionado
Posts: 1994
Joined: Tue Apr 29, 2003 5:55 pm
Location: Minnesota, USA
Contact:

Post by Leaf »

How or what command are you using to start the server?
User avatar
Azriel
Regular
Posts: 85
Joined: Thu May 13, 2004 7:33 am

Post by Azriel »

I just type "crossfire" in a xterm. (I have an imac with X11).

what's strange is that after some amount of time, i can restart the server.

NB : even if i kill X11 and restart it, i still can't resart the server before around 5 or 10 minutes. If i type CTRL C to stop the server, i can restart the server if noone was logged on the server, and i can't if someone was logged, even if i quit the client after.
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

I think there exist 'debug' flags in socket code (not necessarily used in crossfire) that prevent a program from using a port which has been used as server port during 10 mins after the program exited.

Sounds like those flags are on, maybe?

Ie it's a system feature, to lock the port for 10m after server crashed.
Post Reply