Log in

View Full Version : Problem: Linux dom3 servers keep dying.


anotherkenlon
June 19th, 2010, 05:16 AM
I've set up a linux machine pretty much for the purpose of running Dom3 games.

Unfortunately, Dom3 will not stay running for any length of time. I'm at my wit's end on this one.

Here's an example of what shows up in the log when one of the servers die:

gameserver got packet 9
tcp_get2hfile: gname:dawnofdominions pl:3
tcp_get2hfile: pl 3 len 5007
tcp_get2hfile: saving as /home/kenlon/dominions3/savedgames/dawnofdominions/early_marverni.2h
/home/kenlon/dominions3/savedgames/dawnofdominions/early_marverni.2h
N<E5>got gick fel!
savefile: error opening file
N<E5>got gick fel!
savefile: error opening file
Sound deinited

I also ran strace on one of the dom3 processes, and as far as I can tell, it's losing the ability to read from/write to /home/kenlon/dominions3/savedgames at random - which is weird as hell, because I set the damn directory to 777 so anyone and anything can write to it.

Help!

Gandalf Parker
June 19th, 2010, 09:53 AM
I havent seen that one.
Does this work?
file /home/kenlon/dominions3/savedgames/dawnofdominions/*

you might try using the --preexec switch to have a pre.sh save all environmental variables to a text file.
touch env.txt
env >env.txt
set >>env.txt

The above will tell you if its something about files in general or just the 2h

is there a directory quota?
is there a security protection against binary files?

Gandalf Parker
June 19th, 2010, 11:01 AM
another thought..
is this sporadic? maybe its a clash. Maybe its two player files coming in at once. Does the server have quality controls on the number of streams and instances that one user is allowed to grab?

anotherkenlon
June 19th, 2010, 06:26 PM
File is able to read all the files in all the game directories.
No quotas of any sort in place. Not sure what you mean by "security protection against binary files".

Something I only just thought of - I've been using a script to kick off all four servers at the same time. Could that have something to do with this? I know that means they end up with the same temp directory, but in any sanely written program that shouldn't matter.

Gandalf Parker
June 19th, 2010, 08:47 PM
It shouldnt.
But in general I take great steps to avoid running games at the same time. Just for load sake

anotherkenlon
June 20th, 2010, 05:52 PM
Excerpt from the tail end of the strace:

write(1, "uncompressing decomplen = 11260 "..., 54) = 54
write(1, "gameserver got packet 9\n", 24) = 24
write(1, "tcp_get2hfile: gname:itwasadom3g"..., 42) = 42
write(1, "tcp_get2hfile: pl 44 len 11252\n", 31) = 31
open("/home/kenlon/dominions3/savedgames/itwasadom3game", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = -1 ENOENT (No such file or directory)
open("/home/kenlon/dominions3/savedgames/itwasadom3game", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = -1 ENOENT (No such file or directory)
mkdir("/home/kenlon/dominions3/savedgames/itwasadom3game", 0755) = -1 ENOENT (No such file or directory)
open("/home/kenlon/dominions3/savedgames", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = -1 ENOENT (No such file or directory)
mkdir("/home/kenlon/dominions3/savedgames", 0755) = -1 ENOENT (No such file or directory)
open("/home/kenlon/dominions3", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = -1 ENOENT (No such file or directory)
mkdir("/home/kenlon/dominions3", 0755) = -1 EACCES (Permission denied)
open("/home/kenlon", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
open("/home", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
mkdir("/home/kenlon/dominions3", 0755) = -1 EACCES (Permission denied)
open("/home/kenlon", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
open("/home", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
mkdir("/home/kenlon/dominions3/savedgames", 0755) = -1 ENOENT (No such file or directory)
open("/home/kenlon/dominions3", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = -1 ENOENT (No such file or directory)
mkdir("/home/kenlon/dominions3", 0755) = -1 EACCES (Permission denied)
open("/home/kenlon", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
open("/home", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
mkdir("/home/kenlon/dominions3", 0755) = -1 EACCES (Permission denied)
open("/home/kenlon", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
open("/home", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOE XEC) = 6
close(6) = 0
mkdir("/home/kenlon/dominions3/savedgames/itwasadom3game", 0755) = -1 ENOENT (No such file or directory)
write(1, "tcp_get2hfile: saving as /home/k"..., 91) = 91
open("/home/kenlon/dominions3/savedgames/itwasadom3game/mid_bakemono.2h", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
write(1, "/home/kenlon/dominions3/savedgam"..., 66) = 66
write(2, "N\345got gick fel!\n", 16) = 16
write(2, "savefile: error opening file\n", 29) = 29
write(1, "N\345got gick fel!\n", 16) = 16
write(1, "savefile: error opening file\n", 29) = 29

Gandalf Parker
June 20th, 2010, 07:00 PM
Its not supposed to need it but for my scripts (for other reasons) I create the game directory manually with a mkdir command. You might try that.

anotherkenlon
June 20th, 2010, 08:21 PM
The directories are there, though.

And now a couple of the servers are just looping when people try to get their turns:


tcp_putturn: gname:duskofdominions pl:70
tcp_putturn: no turn file (/home/kenlon/dominions3/savedgames/duskofdominions/late_pythium.trn)


It looks like the same damn thing - it can't read the directory. But I've set dominions3, savedgames, and the individual game directories to 777 and it *still* craps out.

Aagh!

thejeff
June 20th, 2010, 09:13 PM
Just a quick thought: Who is the game server running as?
If it's not you (kenlon), try that. Alternately, try changing the owner of the savedgames directory to that user.
Shouldn't be necessary, but it's the only thing I can think of.

anotherkenlon
June 20th, 2010, 10:08 PM
Just a quick thought: Who is the game server running as?
If it's not you (kenlon), try that. Alternately, try changing the owner of the savedgames directory to that user.
Shouldn't be necessary, but it's the only thing I can think of.

It's running as me - I'm spawning the servers via a small script.

Gandalf Parker
June 21st, 2010, 09:47 AM
Just as a test (I would NOT recommend running this way)
can root or sudo run a game?

anotherkenlon
June 22nd, 2010, 12:31 AM
Running as root has netted identical errors from two of the four games when people were uploading/downloading turns:


open("/home/kenlon/dominions3/savedgames/itwasadom3game/ftherlnd", O_RDONLY) = -1 ENOENT (No such file or directory)


I'm running Ubuntu 10.04 x86-pae, so it's a 32 bit system. I'm running out of ideas here.

Gandalf Parker
June 22nd, 2010, 09:38 AM
OK now we are just shooting in the dark.

2 out of 4 games?
Have you checked the port numbers you used against your services list? Usually...
cat /etc/services

Or have you run netstat when it happens to see if something is kicking in on the same port?

You might even check a more complete services list such as
https://isc.sans.edu//services.html
to see if your ISP is blocking some port "for your protection". Ive had some games run into problems with that altho usually its the players ISP since Ive taken great pains to have no friendly filtering on my connections.

anotherkenlon
June 22nd, 2010, 09:52 AM
If the problem was due to something grabbing the port I'd be seeing very different errors - the strace log is pretty conclusive: The servers are dying because they can't read/write to directories and files where they have full permission.

Since the board isn't flooded with reports of dom3 failing to work properly under Linux, it has to be something about my install that's doing it. I'm going to go back to 9.10 and start over.