mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 06:05:57 +03:00
[GH-ISSUE #561] Weird Problem with tmux sessions? #454
Labels
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @robingroppe on GitHub (Dec 18, 2015).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/561
Hey i ran into a problem yesterday.
I have one user and in the homedir is a csgoserver and a insserver folder with the lsgm in it.
I can start both the server alone just fine. But when i try to start both it is not working.
When the csgoserver is running and i try to start insserver it tells me that the session ins-server cannot be found.
When insserver is running and i want to start csgoserver it tells me that the server is already running but in fact insserver is the only thing running.
Ubuntu Trusty, tried with distro tmux and backported 1.9.8 neither works.
@UltimateByte commented on GitHub (Dec 18, 2015):
Hi,
Did you make one user per server as expected ?
@robingroppe commented on GitHub (Dec 18, 2015):
Nope, I got only one user for the gameservers.
I prevously had a larger gameserver with 4-6 lgsm instances with one user and it worked fine.
Why should that be a problem? The session-name is different.
@UltimateByte commented on GitHub (Dec 18, 2015):
As far as i know, it's very recommended to make one user per server.
It's not only a LGSM recommandation, it's also a global linux recommandation.
I don't know if you're new to linux, i'm only into it since like 2 years, but at the beginning, i thought it was boring to make a new user every single time... But in the end, it makes things so easier to diagnose when you have a problem, like when you wanna see what's running from a user, or kill a user's process...
Then with this script, you can use a root crontab to monitor/reboot all users' servers in one place.
It's also more secured.
And if it's FTP management that bores you, if you're using proftpd, you can set it so FTP users match the machine's users. So every time you make a new user, it makes the corresponding FTP session.
BTW, it still seems weird.
If somebody reading this has enough knowledge to understand them, here are the suspected responsible lines.
https://github.com/dgibbs64/linuxgsm/blob/master/functions/fn_start#L143
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
https://github.com/dgibbs64/linuxgsm/blob/master/functions/fn_start#L117
if [ "${tmuxwc}" -eq 1 ]; then
fn_printinfo "${servername} is already running"
fn_scriptlog "${servername} is already running"
sleep 1
echo -en "\n"
exit
fi
@robingroppe commented on GitHub (Dec 18, 2015):
Actually I am not new to linux. I use it every day on my deskop and on my servers.
I know that that the general recommendations suggest using one user per service, mostly due to security reasons.
But I think for a few gameservers I dont need multiple users.
Earlier this year it has worked flawlessly and I dont know why its not working anymore.
@dgibbs64 commented on GitHub (Dec 18, 2015):
It is recommended to use separate users for the reasons @UltimateByte suggested. However it isnt required. for example /home/lgsm should work fine.
tmuxwc variable gives the number of active sessions running the same session name. For example if there is already a session called ins-server it will state its already running. This stops accidentally starting the server multiple times. The only way it will state its already running if ins-server session is active. I would re download csgoserver and insserver again and try then. Maybe check that all tmux sessions are killed and processess ended.
The outputs of ./csgoserver details and ./insserver details may give use more useful info
@robingroppe commented on GitHub (Dec 18, 2015):
I dont think so. I killed all tmux sessions prevously.
I can only give information about csgo atm as I purged the insserver install to reinstall it later.
I will let you know how it went.
csgo:
https://www.zerobin.tk/?bb3e862d72f2d8be#Q8O5voXsMzbAJ0eKDESddbOIeyIl+V7218KyBnyk4Og=
@dgibbs64 commented on GitHub (Dec 18, 2015):
@robingroppe I cannot see anything odd in your details. Here hopfully a fresh install of ins-server helps
@robingroppe commented on GitHub (Dec 23, 2015):
Okay, the story goes on.
Now I am trying to set up a second csgo server.
Both can be started seperately but if one in running and i want to start the second one, it is starting and killing the first one.
Something is really wrong here.
Details of the second server:
https://www.zerobin.tk/?6ad6e7f8895d48dd#SFJWJ2OQKj82PixF5miwzPG90Ekz1wi1prACGew4dV0=
@robingroppe commented on GitHub (Dec 23, 2015):
I got both of them running now by changing the session name of the second server to "casual" instead of "csgo-server-casu".
So there is only a problem if the first session is "csgo-server" and the second "csgo-server-casu".
@UltimateByte commented on GitHub (Dec 23, 2015):
Seems like the script or tmux can't make the difference between names like XXX-YY and XXX-ZZ.
@jaredballou commented on GitHub (Jan 6, 2016):
Is the service name a factor here? I had problems with symlinked scripts blowing up when I didn;t tie the servicename variable to the name of the symlink. Would you mind putting up your modified server scripts for us to review?
@UltimateByte commented on GitHub (Jan 6, 2016):
Well, just tried with gmod servers on the same user.
If i set
Server 1) servicename="gmod-server1"
Server 2) servicename="gmod-server2"
Then start both, they both work correctly, but the 2 displays UNAVAILABLE instead of the servername at start/stop commands.
So i tried inverting the service names :
Server 1) servicename="gmod-server2"
Server 2) servicename="gmod-server1"
Then it's server one that displays errors.
So i tried whole different names :
Server 1) servicename="gmodserver1"
Server 2) servicename="gmodserver2"
Then both display UNAVAILABLE at start, but work as intended.
@dgibbs64
So there is actually a problem in the way servicename is managed.
@robingroppe commented on GitHub (Jan 6, 2016):
This is a regession. About one year ago I installed a set of csgo servers.
One named csgo-server-comp and the other csgo-server-casu and it worked
perfectly. something must have been changes in the way service names are
handled.
Am 06.01.2016 14:46 schrieb "UltimateByte" notifications@github.com:
@UltimateByte commented on GitHub (Jan 6, 2016):
Well, i'm pretty sure it's related to fn_start_tmux, but i have to admitt my knowledge isn't good enough yet to understand how it really works and why it could fail.
https://github.com/dgibbs64/linuxgsm/blob/master/functions/command_start.sh#L74
I won't be able to help anymore with that one any time soon.
@dgibbs64 commented on GitHub (Jan 6, 2016):
It stated UNAVAILABLE if LGSM cannot see the config file. I will have to try to add a check to warn if the config file is not accessable
@robingroppe commented on GitHub (Jan 6, 2016):
Yes but thats only the result of lgsm not knowing what session the command is about.
As I said, weird things happen when messing around with these things. I saw the unavailable too.
I have not investigated this problem yet.
Do you recall commiting any changes to the way lsgm handles the sessions? @dgibbs64
@UltimateByte commented on GitHub (Jan 6, 2016):
OK thanks dgibbs64, so that's due to the fact that if you change servicename, you have to change server config name too.
Example : Using servicename="blabla", you should rename "gmod-server.cfg" to "blabla.cfg"
Or, better way in my opinion : change servercfg="${servicename}.cfg" to servercfg="gmod-server.cfg".
So @dgibbs64 i see two ways to fix this issue.
Either if the cfg file isn't detected, it downloads it again with the new service name, or, we make servercfg to a fixed value, not a variable.
@dgibbs64 commented on GitHub (Jan 6, 2016):
Added a new check https://github.com/dgibbs64/linuxgsm/pull/611
Please test and see if this helps. Im not sure if this will fix this particular issue but may help users a little more with multiple servers
I may add the option to download a default config however that may confuse the user if they miss the warning as downloading the default config would cause the message to stop
@dgibbs64 commented on GitHub (Jan 6, 2016):
@robingroppe I don't think I have changed how sessions work for a long time. It is very odd tmux is getting confused about session names
Just to confirm the issue as im slightly confused
Setup one server csgoserver
Setup another server insserver in the same user
When starting one server the other was stopping
Now the service names have been changed to something else the issue is resolved.
@JimTR commented on GitHub (Jan 6, 2016):
I test if servicename.cfg exists if not use lsgm-default.cfg
@robingroppe commented on GitHub (Jan 6, 2016):
Absolutely correct.
Where server1 and 2 are the servicenames.
Server one and two alone are running fine but both server at once is not working because both have the word "server" in the servicename. I just confirmed that by setting one servicename to "somethingdifferent".
And both servers work as expected.
@JimTR commented on GitHub (Jan 6, 2016):
nope incorrect just add something to the end of the service name ... you then get tmux sessions like

so you could install at /home/user/games/gamename
copy the executable eg cgso-server to cgso-server1 .. edit cgso-server1 so the ports are different & the service name is different then make sure you have cfg files that match the service name
@robingroppe commented on GitHub (Jan 6, 2016):
Exactly that is not working for me.
csgo-server-1
csgo-server-2
.
.
.
Are you using recent function files?
@JimTR commented on GitHub (Jan 6, 2016):
what is the result if you run 'tmux ls' in a terminal ?
@robingroppe commented on GitHub (Jan 6, 2016):
https://www.zerobin.tk/?af6e6fc568e1a800#iPowQg8bFBKH9KxiL4IkAduPCzMQKvXdCzUB6gZ3e0Y=
@robingroppe commented on GitHub (Jan 6, 2016):
As you can see, I start the first one, then the second one.
After doing that only the second one is running.
@JimTR commented on GitHub (Jan 6, 2016):
so I just don't get this are you sure that both service names are different why not 'tmux ls' after the start of the first server (note the session) then start the second ? and run tmux ls again. from the screen shot provided it is difficult to work out what has gone on with session 1
@robingroppe commented on GitHub (Jan 6, 2016):
https://www.zerobin.tk/?8e765aa5b18952a5#CWyt0GuLSXMGM2MAReS1TWCN3ugZJLAhkOZ40NaUFo4=
@robingroppe commented on GitHub (Jan 6, 2016):
https://www.zerobin.tk/?b52604f38ee09c67#qjqE0PTcI0P5+eBYD1GyLKGYEvaxJSQZNEcL4FMQ/iY=
@JimTR commented on GitHub (Jan 6, 2016):
That sort of indicates there is something wrong with your server setup .. unless you are going to tell me that server1 runs for weeks ... then I add server2 & it fails .... to be fair I would delete both server installs & start again ... do server install get that one running fine (test it for a while) then copy the executable so 'cp server server2 ' edit server2 to reflect the new ports (note you will have to change all 3) and change the service name then create a config file to suit the service name just a thought what version of linux does your machine use ?
@robingroppe commented on GitHub (Jan 6, 2016):
My server setup is fine.
I replicated it in a virtual machine a few days ago.
Server one is absolutely reliable.
What you described is exactly what i have done a few hours ago.
Still Ubuntu Trusty ;) And I have tested with the distro tmux version and with a newer backported version.
@JimTR commented on GitHub (Jan 7, 2016):
you miss the point ... when I refer to server I mean the game server(s) I have no doubt that your server is running fine hence why I said just remove the games servers & start again. I have 56 servers running across about 8 unix users and don't get the issue using ubuntu 14.04 server so I guess there is a game server issue
@robingroppe commented on GitHub (Jan 7, 2016):
On Insurgency and Counter-Strike?
@JimTR commented on GitHub (Jan 7, 2016):
if you looked at the image you would see 1 Cs a few Gmod a No More Room In Hell etc ... the screen shot was from 1 user tbf I could not (unless I looked) tell you what else is running across the other users all run with no issue @robingroppe you have the issue I am trying to help you fix it
@robingroppe commented on GitHub (Jan 7, 2016):
Okay. I used to run a comparable set of gameservers which i install a year a go or so without any problems.
Is this problem confirmed by anyone or am I the only one with this issue?
@UltimateByte ?
@UltimateByte commented on GitHub (Jan 7, 2016):
I personally tried 2 things :
1 user, 2 separate folders, 2 different servicenames : gmod-server1 and gmod-server2.
=> As long as i've got one .cfg file per server that is the same name as servicename, it runs fine.
1 user, 1 folder, 2 different scripts with different servicenames and corresponding .cfg files
=> Works fine too.
Output :
serverdev@lrob:
/gmodserver1$ ./gmodserver start/gmodserver1$ ./gmodserver2 start[ OK ] Starting gmod-server1: whatever
serverdev@lrob:
[ OK ] Starting gmod-server2: whatever2 test serv
serverdev@lrob:
/gmodserver1$ tmux ls/gmodserver1$gmod-server1: 1 windows (created Thu Jan 7 14:51:28 2016) [105x48]
gmod-server2: 1 windows (created Thu Jan 7 14:51:38 2016) [105x48]
serverdev@lrob:
I first messed up with script session names before getting it working though. So be careful, and then i see no reason why it wouldn't work.
As a reminder, i'm using Debian 8.2
@robingroppe commented on GitHub (Jan 7, 2016):
Okay then probably I messed it up serval times.
Sorry.
@UltimateByte commented on GitHub (Jan 7, 2016):
Please, keep us informed.
I leave that opened for a few days maximum or until you tell us you got it working. :)
@UltimateByte commented on GitHub (Jan 23, 2016):
As i coudln't reproduce the issue and no update for the OP, closing this.
Feel free to re-open if needed.
@lock[bot] commented on GitHub (Jul 19, 2018):
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.