GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.33k stars 821 forks source link

weird log check error #970

Closed mightyBroccoli closed 8 years ago

mightyBroccoli commented 8 years ago

I do get a weird error. First I am running the server a the user csgo without a valid shell. Normally I do use sudo -u csgo everything works the server starts up and no errors or anything. But when I restart the server with the intention to clean out old log files i get these errors no abort though.

`find: pred.c:1932: launch: Assertion starting_desc >= 0' failed.
/home/csgo/linuxgsm/CounterStrikeGlobalOffensive/lgsm/functions/logs.sh: line 100: 15601 Aborted                 find "${scriptlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;

find: pred.c:1932: launch: Assertion starting_desc >= 0' failed.
/home/csgo/linuxgsm/CounterStrikeGlobalOffensive/lgsm/functions/logs.sh: line 100: 15607 Aborted                 find "${gamelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;

find: pred.c:1932: launch: Assertion starting_desc >= 0' failed.
/home/csgo/linuxgsm/CounterStrikeGlobalOffensive/lgsm/functions/logs.sh: line 100: 15613 Aborted                 find "${consolelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;

find: pred.c:1932: launch: Assertion starting_desc >= 0' failed.
/home/csgo/linuxgsm/CounterStrikeGlobalOffensive/lgsm/functions/logs.sh: line 100: 15619 Aborted                 find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;

find: pred.c:1932: launch: Assertion starting_desc >= 0' failed.
/home/csgo/linuxgsm/CounterStrikeGlobalOffensive/lgsm/functions/logs.sh: line 100: 15625 Aborted                 find "${legacyserverlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;`

When I then just switch to the user csgo everything works fine. I will attach the complete log with the first sudo -u csgo try and directly after that the su csgo try.

https://paste.xinu.at/QHfCKk/

dgibbs64 commented 8 years ago

Im not sure on this one. I have had a quick google but nothing useful :/

UltimateByte commented 8 years ago

Paste expired. I'd suggest using a valid shell as it's the intended way for LGSM to work. Also, what distro are you using ?

mightyBroccoli commented 8 years ago

I don't know what happend there the paste is still active but github is not redirecting properly. https://paste.xinu.at/QHfCKk/

I am using Debian Jessie 64bit. The shell I am using is just for the security. The user does have all rights in all folders and for all files. That'S why this issue is that wierd.

UltimateByte commented 8 years ago

To me, seems like your user doesn't have access to the proper command used to sort logs by date.

Here https://github.com/dgibbs64/linuxgsm/blob/master/lgsm/functions/logs.sh#L29

HF finding which one it is ! :p (I'd look for -mtime and find first.)

cedarlug commented 8 years ago

What is the default shell for your csgo user?

getent passwd csgo | cut -d: -f7

You're likely running the find commands using /bin/sh on Debian when the user is created without a specified shell. /bin/sh won't expand the script variables the same way as the bash shell does.

You'll have the same issue with ksh, rsh, and dash.

Change the csgo user's shell to /bin/bash and see if that fixes the issue:

usermod -s /bin/bash csgo

dgibbs64 commented 8 years ago

@cedarlug Do you know if there a way of preventing this within LGSM to allow users to run shells like dash without LGSM having issues?

UltimateByte commented 8 years ago

Closing as no feedback and isolated issue. BTW, lgsm is a bash script, not a dash. So ofc expect errors if you're not using bash. Feel free to submit fixes that would help if you wish to use something else than bash.

lock[bot] commented 6 years ago

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.