Xonotic Forums
[SOLVED] server.cfg: bind returned error: Address already in use - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: [SOLVED] server.cfg: bind returned error: Address already in use (/showthread.php?tid=2878)



server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

Stupid question number 1056:


The configurtaion file server.26001.cfg has this entry
port 26001 // the port used by the server

Start up gives this message.
Code:
Server using port 26000
LHNET_OpenSocket_Connectionless: bind returned error: Address already in use
Server failed to open socket on address 0.0.0.0:26000
Server listening on address 0.0.0.0:26001
LHNET_OpenSocket_Connectionless: bind returned error: Address already in use
Server failed to open socket on address [0:0:0:0:0:0:0:0]:26000
Server listening on address [0:0:0:0:0:0:0:0]:26001
Initializing ClientSide information entities
Error response from keygen server: Not allowed


I thought this was because the startup script parses the distribution server.cfg first and then applies the new server.cfg afterwards, so I removed the distribution server.cfg.

However the same message is displayed


RE: server.cfg: bind returned error: Address already in use - Mr. Bougo - 04-12-2012

Are you sure server.26001.cfg is executed at all? How do you launch the server?


Also, I edited your post title, as the default reply subject length was above threshold, which presented me with a not very user-friendly message that my subject was too long while I didn't type any.


RE: server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

With this modified startup script.

$ cat /usr/local/xonotic/server/server_linux.26001.sh
Code:
#!/bin/sh

case "$(uname -m)" in
  x86_64)    executable="xonotic-linux64-dedicated" ;;
  *)        executable="xonotic-linux32-dedicated" ;;
esac

cd "`dirname "${0}"`"

if ! [ -x "$executable" ]; then
    if [ -x "../$executable" ] && { [ -f ~/.xonotic/data/server.26001.cfg ] || [ -f ../data/server.cfg ]; }; then
        cd ..
    else
        echo "This script is not properly set up yet."
        echo "Please refer to the instructions in readme.txt."
        echo "In short:"
        echo "- copy server.cfg to the data directory and adjust its settings"
        echo "- move this file to the main directory of your Xonotic installation"
        exit 1
    fi
fi

exec ./${executable} -sessionid lock.26001  +serverconfig server.cfg "${@}"

Oh - I see the problem !!!! Big Grin

Server is up.


RE: server.cfg: bind returned error: Address already in use - Mr. Bougo - 04-12-2012

Hehe Tongue


RE: server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

(04-12-2012, 07:16 AM)nonenone Wrote: With this modified startup script.

$ cat /usr/local/xonotic/server/server_linux.26001.sh
Code:
#!/bin/sh

case "$(uname -m)" in
  x86_64)    executable="xonotic-linux64-dedicated" ;;
  *)        executable="xonotic-linux32-dedicated" ;;
esac

cd "`dirname "${0}"`"

if ! [ -x "$executable" ]; then
    if [ -x "../$executable" ] && { [ -f ~/.xonotic/data/server.26001.cfg ] || [ -f ../data/server.cfg ]; }; then
        cd ..
    else
        echo "This script is not properly set up yet."
        echo "Please refer to the instructions in readme.txt."
        echo "In short:"
        echo "- copy server.cfg to the data directory and adjust its settings"
        echo "- move this file to the main directory of your Xonotic installation"
        exit 1
    fi
fi

exec ./${executable} -sessionid lock.26001  +serverconfig server.cfg "${@}"

Oh - I see the problem !!!! Big Grin

Server is up.

Interesting. Although it starts, I got this:
Code:
[20121704/12/12_1417:21]menu: program is not loaded
[20121704/12/12_1417:21]Server using port 26001
[20121704/12/12_1417:21]Server listening on address 0.0.0.0:26001
[20121704/12/12_1417:21]Server listening on address [0:0:0:0:0:0:0:0]:26001
[20121704/12/12_1417:22]:gameinfo:mutators:LIST:Vampire:grappling_hook:no_powerups
SNIP
[20121704/12/12_1417:36]:startdelay_ended
[20121704/12/12_1417:42]Error response from keygen server: Not allowed
Note that port 26001 is not yet open on the firewall (still awaiting the firewall guy to make the change)


RE: server.cfg: bind returned error: Address already in use - divVerent - 04-12-2012

That output is fine.


RE: server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

Yet, the server still won't display in the list of available servers.
The ports are open:
# nmap -sU -p 26001 1.2.3.4
Starting Nmap 5.00 ( http://nmap.org ) at 2012-04-12 22:57 CEST
Interesting ports on example.com (1.2.3.4):
PORT STATE SERVICE
26001/udp open|filtered unknown

# lsof -i udp:26001
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xonotic-l 16009 xonotic 79u IPv4 2771807 0t0 UDP *:26001
xonotic-l 16009 xonotic 80u IPv6 2771808 0t0 UDP *:26001

ps -eaf|grep 16009
xonotic 16009 1 0 17:56 ? 00:00:59 ./xonotic-linux64-dedicated -sessionid lock.26001 +serverconfig server.26001.cfg


RE: server.cfg: bind returned error: Address already in use - Mr. Bougo - 04-12-2012

If the server is public, why are you obfuscating its IP?

Have you tried querying the server directly using that url I showed you earlier?
Code:
http://dpmaster.deathmask.net/?game=xonotic&server=ip:port



RE: server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

I did not read the url you posted. Sorry. I was too quick.

Obfuscated purely out of habit. No need at all. Its public.


http://dpmaster.deathmask.net/?game=xonotic&server=mx0.klunky.co.uk:26001


Server reply:

ADDRESS
PLAYERS
MAP
GAMETYPE
NAME

mx0.klunky.co.uk:26001
NO RESPONSE
Powered by QStat 2.11 & dpmaster.deathmask.net Master Server list


RE: server.cfg: bind returned error: Address already in use - Mr. Bougo - 04-12-2012

Seems like your firewall is still blocking it.

PORT STATE SERVICE
26000/udp open quake
26001/udp open|filtered unknown


RE: server.cfg: bind returned error: Address already in use - nonenone - 04-12-2012

Oh. Groan. Missed this. I seem to be setting a trend here of skim reading and missing the obvious.

I hope they'll amend the f/w tomorrow.

I'm off to bed.
Night.