mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 06:05:57 +03:00
[GH-ISSUE #3313] [BUG] Changing default user shell renders LinuxGSM inoperable #2289
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#2289
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 @Memphizzz on GitHub (Feb 28, 2021).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3313
User Story
It looks like LinuxGSM does not take kindly to changing the users default shell.
Example: the vhserver user has default shell
/usr/bin/fishset when runningwget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh vhserverand./vhserver install. Starting and stopping the server works just fine using./vhserver start/stop. Now if we change the shell to bash for examplechsh -s /bin/bash../vhserver stopor/vhserver detailsdoesn't seem to work at all anymore whereasstartdoes start the server but the shell hangs with output[ .... ] Starting vhserver: <serverName>.Basic info
Further Information
To Reproduce
Steps to reproduce the behaviour:
/usr/bin/fishfor thevhserveruser./vhserver start./vhserver stopchsh -s /bin/bashto bashexitto quit the current shell and login again usingsu - vhserverExpected behaviour
Same as when using /usr/bin/fish.
@dgibbs64 commented on GitHub (Feb 28, 2021):
LinuxGSM is written in bash and not tested with another shell such as fish.
@Memphizzz commented on GitHub (Feb 28, 2021):
I understand that but that shouldn't force the users shell to bash now does it?
Shouldn't a simple shebang like
#!/bin/bashor even better#!/usr/bin/env bashbe an easy fix for this?As far as I can see the vhserver file itself contains it but it might be missing in some other scripts that get called by it?
Whatever the case, the fact remains that after changing the shell to bash this problem occurs. I assume the script is somewhere storing something from the shell it was installed with which then doesn't work after changing the shell to bash.
@dgibbs64 commented on GitHub (Feb 28, 2021):
Every file contains '#!/bin/bash' on its first line so I am unsure why you are having issues with this 🤔
@Memphizzz commented on GitHub (Feb 28, 2021):
I will try and analyze it a bit more in the coming days, for now I have to leave the shell set to fish as a workaround then. Interestingly creating a sub-process using
bash -c './vhserver details'from fish does work but it refuses to work if the login shell is set to bash. I suspect it has something to do with environment variables..@Xalorous commented on GitHub (Mar 3, 2021):
I understand that but that shouldn't force the users shell to bash now does it?Actually, yes. Fish !=bash. Those who run fish do so because they want something that it offers that bash does not.
If you want a gameserver system that runs in fish, you can always fork it and port it. @dgibbs64 created and maintains this on a volunteer basis, with support from donations, and with help from contributors, but the product is free to use.
It would be extremely difficult to maintain this project in two shells. Also, if the project adds fish, what about Bourne, C shell, zsh? Lots of folks use these shells as well. Go into the repo here and look at all the files. Yes, there are bashisms hardcoded into this complex code. No, it's not reasonable to expect a piece of software written in a shell script to run in all shells.
Bottom line, bash is a prerequisite for the user created to run the scripts.
My suggestion? Delete the gameserver user, or at least the linuxgsm files in that user's home. Create a new user or users to run your server or servers. Make their shell /bin/bash. Install fresh. Leave their shells alone. The gameserver admin uses a handlful of commands, and even adding optional cron jobs for updates and status monitoring is simple enough in bash. This will not prevent you from using fish on any number of user accounts.
@WildPenquin commented on GitHub (Mar 4, 2021):
My 2 cents as another regular user:
This seems like a bug in Fish, if I've uinderstood the bug report correctly. I.e.: installing via fish produces different output than installing via bash. Another point of view: fish does not actually run the scripts by bash despite them having the shebang, or if it does run scripts by itself by design, it should behave like bash - not something else. Either way, it's a bug in fish. These are bash scripts and should remain compatible with bash despite being run by fish.
I would suggest repeat this bug with a clean user account running fish and then make exact same thing with another user account running bash and then compare the difference. Otherwise it can be a bit difficult to see what is actually going on with fish.
Another point: one should not run linuxgsm with a user which has the user shell set to something which could be considered "exotic" from linuxgsm's point of view. I know it can be considered as a workaround (in fish or LinuxGSM) and as such is not an excuse to fixing actual bugs, however running server software as a regular user with their own configuration (being set up like how it is for whatever reason) is like asking for trouble, and generally not a good idea IMHO.
(EDITed second paragraph, it was conveying a wrong message I was trying to say!)
@Memphizzz commented on GitHub (Mar 4, 2021):
@WildPenquin It actually doesn't though, the scripts run fine in fish. It just for some reason that when you switch the shell to bash that it stops working.
@WildPenquin commented on GitHub (Mar 4, 2021):
What doesn't what?
Fish certainly does something differently than bash (<- this is my claim!), since the installation stops working with bash if you've made it with fish (as per your bug report). That's why I suggested you re-create the situation once more with fish and make an identical installation with bash and compare (with diff or something similar). That way we can see where fish goes wrong - or, maybe there's something else going on. Either way, without this comparison IMO this bug report should be closed (though I'm not the one to make that decision), and with that comparison you could gather enough information to make a bug report against fish or (in the unlikely event) perhaps have some grounds for keeping this bug report open.
@Memphizzz commented on GitHub (Mar 4, 2021):
@WildPenquin It doesn't give different output.
@WildPenquin @Xalorous Since the shebang is present everywhere, it ensures that bash is used to interpret the script even if launched from another shell, in other words the script is executed in bash no matter what shell runs the script, hence my confusion on why changing the login shell TO bash messes things up.
@Xalorous commented on GitHub (Mar 4, 2021):
Bottom line, LGSM is supported on bash, not fish. So this is not a bug in
LGSM (I'm using "the code doesn't do something that it is supposed to do"
as a working definition of bug).
Having said that, I have no problem working to help find out if there is a
workaround here.
From what I understand the sequence went like this:
running system)
When you went from "working under fish" to "switched to bash", you may have
lost environment variables or configuration that is needed. I'm curious,
did you reload the environment after changing to bash? The easiest way
would be to modify the default environment of the user, log out, then log
in again.
Finally, if your goal is to learn about Linux and system administration,
this is an interesting exercise. If you just want the server to be up and
running, my suggestion remains what it was before. Use a stock, out of the
box user, with bash, for the server admin. I recommend a dedicated vm for
the game server.
If you want to learn Linux admin, or various tools under Linux, build one
or more separate vms. If you use snapshots liberally, you can break and
revert your vms at will.
On Thu, Mar 4, 2021 at 6:15 AM WildPenguin notifications@github.com wrote:
@Memphizzz commented on GitHub (Mar 4, 2021):
@dgibbs64 I found the issue. It's the
tmux list-sessions...call incheck_status.sh. To verify if tmux is installed the script seems to be usingdpkg-querybut if the system has another tmux version installed besides the one from the distro and in it'sPATHthe call to tmux might use the wrong binary. I would suggest having the installer script also store the full path of the dependencies (usingdpkg -L <package>for example) and use that to call them.