callofduty4x / CoD4x_Server

Extended Call of Duty 4 server
https://cod4x.ovh
GNU Affero General Public License v3.0
333 stars 121 forks source link

kill then start server causes "Warning: NET_IP4Socket: bind: Address already in use" #427

Open bbashy opened 7 months ago

bbashy commented 7 months ago

Getting an issue where it thinks the port is still in-use when restarting servers.

I use kill -15 <pid> and then start it back up 30 seconds later. When it starts it crashes and has the following;

Opening IP socket: 45.282.361.513:28960 UDP
[1;33mWarning: NET_IP4Socket: bind: Address already in use
---- Network shutdown ----
--------------------------

Sys_Error: Could not bind to a IPv4 network socket

Is there a solution to gracefully kill it? I don't get the same issue with CoD4 1.7 servers.

D4edalus commented 7 months ago

try fuser -k 28960/udp

https://stackoverflow.com/a/11596144

bbashy commented 7 months ago

Comment says port will still be unavailable for 60 seconds. Might just wait 60 seconds instead just for CoD4x servers.

K-Faktor commented 7 months ago

pkill -f