Linuxgsm: gamelogdir has to be reworked

Created on 20 Feb 2017  路  5Comments  路  Source: GameServerManagers/LinuxGSM

Many servers have gamelogdir="${rootdir}/log/server" which isn't really desired, is it? (unnecessary symbolic linkception). Just search for gamelogdir="${rootdir}/log/server" to find some of them. (also mumble?)

Furthermore the server log should be set to the correct file (e.g. Hurtworld just uses "gamelog.txt" currently; Teeworlds is misconfigured; ..).

Moreover "gamelogfile" which doesn't even exist (?) is used in the following check: logs.sh#L20
I guess it should have been "gamelogdir"?

bug feature request

All 5 comments

You're right, I felt there was something wrong when working on gamelogdir which is useful to some games, but appeared to be unnecessary for others. This needs an overhaul revision.

I didn't remember Hurtworld having a fixed log name, this needs to be addressed. Thanks for pointing this out.

As for -n "${gamelogfile} , here logs.sh#L20 this was a bit messy and is now a legacy function, but it is actually intended to check for gamelogfile.
Rust didn't have a custom log location, so it was into serverfiles by default, and had to be moved into gamelogdir upon server start, and Rust log was set within ${gamelogfile} var which didn't include ${gamelogdir} as it wouldn't work.
I did the revision for Rust that now supports custom logdir. It's more simple to look at the commit to understand: https://github.com/GameServerManagers/LinuxGSM/commit/92f748c1ca47cad2b120572c5d44402bc0c02af5#diff-34f056db9e8692880a2f240fa083de4c
It is now set with ${gamelogdate} like any other server that allows custom log location/file.

Also, I used 7dtd as a template, and shouldn't have.
Many games have a useless: gamelog="${gamelogdir}/${servicename}-game.log" which needs to be removed and ${gamelogdate} needs to be used instead. Same goes for 7dtd as well that generates date in fn_parm which is very bad.

(edited, don't read in email)

Seing this and gamelogdir usage, it looks like something is wrong in variables management.

Here is how i think it should be:
gamelogdir would only exist if game server has default logs OR we can set custom log location. In any case, gamelogdir="${rootdir}/log/server".
Then another variable would be required for default server logs that we cannot change, like defaultgamelogdir=${systemdir}/location/of/logs.
Then symlink would be:

if [ -n "${defaultgamelogdir}" ]&&[ ! -L "${gamelogdir}" ]; then
    ln -nfsv "${defaultgamelogdir}" "${gamelogdir}"

And then gamelogdir creation would be:

elif [ -n "${gamelogdir}" &&[ ! -d "${gamelogdir}" ]]&&[ -z "${defaultgamelogdir}"  ]; then
    mkdir -pv "${gamelogdir}"
fi

Note: After some research, it looks like -h is legacy check and should be replaced with -L (check if it is a symlink). https://www.freebsd.org/cgi/man.cgi?test

My current solution required no extra vars

# Symlink to gamelogdir
# unless gamelogdir is within logdir
# e.g serverfiles/log is not within log/: symlink created
# log/server is in log/: symlink not created
if [ -n "${gamelogdir}" ]; then
    if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ];then
        ln -nfsv "${gamelogdir}" "${logdir}/server"
    fi
fi

Specific games will need to be reviewed however to make sure that it still works.

The following servers need to be checked
twserver
rustserver
qlserver
all unreal servers
hwserver

This issue was resolved in the latest release

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MicLieg picture MicLieg  路  3Comments

jaredstone1982 picture jaredstone1982  路  3Comments

pavelhoral picture pavelhoral  路  3Comments

Frisasky picture Frisasky  路  3Comments

KuJoe picture KuJoe  路  3Comments