[GH-ISSUE #1111] Unhandled single quotes in config #875

Closed
opened 2026-02-27 02:54:03 +03:00 by kerem · 15 comments
Owner

Originally created by @hatbocs on GitHub (Oct 9, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1111

Found when configuring my csgo server.

// Server Name
hostname "Ba-loo's Comp Server"

When restarting the server I get errors.

csgoserver@baloomain:~$ ./csgoserver restart
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
[ .... ] Stopping csgo-server: NOT SETxargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
[ERROR ] Stopping csgo-server: Graceful: rcon quit: FAIL
[ OK ] Stopping csgo-server: NOT SET
[ .... ] Starting csgo-server: NOT SETxargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
[ OK ] Starting csgo-server: NOT SET

Removing the single quote in the hostname will correct this. hostname "Ba-loos Comp Server"

I traced this back to /lgsm/functions/info_config.sh and added a bit to the servername line. Note -e "s/'//g" which removes stray single quotes.

servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^//d' -e "s/'//g" -e 's/hostname//g' | tr -d '=";,:' | xargs

Not ideal, I think but the only work around I have right now since I'm not great with bash scripting.

I haven't had this issue until a week ago, or so.

Originally created by @hatbocs on GitHub (Oct 9, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1111 Found when configuring my csgo server. > // Server Name > hostname "Ba-loo's Comp Server" When restarting the server I get errors. > csgoserver@baloomain:~$ ./csgoserver restart > xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option > [ .... ] Stopping csgo-server: NOT SETxargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option > [ERROR ] Stopping csgo-server: Graceful: rcon quit: FAIL > [ OK ] Stopping csgo-server: NOT SET > [ .... ] Starting csgo-server: NOT SETxargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option > [ OK ] Starting csgo-server: NOT SET Removing the single quote in the hostname will correct this. `hostname "Ba-loos Comp Server"` I traced this back to /lgsm/functions/info_config.sh and added a bit to the servername line. Note `-e "s/'//g"` which removes stray single quotes. > servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e "s/'//g" -e 's/hostname//g' | tr -d '=\";,:' | xargs Not ideal, I think but the only work around I have right now since I'm not great with bash scripting. I haven't had this issue until a week ago, or so.
kerem 2026-02-27 02:54:03 +03:00
  • closed this issue
  • added the
    type: bug
    label
Author
Owner

@UltimateByte commented on GitHub (Oct 9, 2016):

Thanks for your attention. We need to reproduce this. If you're right, then it's a global bug that needs to be fixed with like a line of code or two. :)
Funny this error didn't come up before, maybe single quotes are not very popular in server titles.

<!-- gh-comment-id:252460348 --> @UltimateByte commented on GitHub (Oct 9, 2016): Thanks for your attention. We need to reproduce this. If you're right, then it's a global bug that needs to be fixed with like a line of code or two. :) Funny this error didn't come up before, maybe single quotes are not very popular in server titles.
Author
Owner

@hatbocs commented on GitHub (Oct 9, 2016):

Thank you much.

Oddly enough, I'm pretty sure some older version of the scripts were handling it just fine because I could have sworn I was using an apostrophe/single quote in the hostname this whole time. The only thing that would have changed was finally getting the newest version of the csgoserver script. The one I was using before was still looking for dgibbs64, if that helps.

<!-- gh-comment-id:252460662 --> @hatbocs commented on GitHub (Oct 9, 2016): Thank you much. Oddly enough, I'm pretty sure some older version of the scripts were handling it just fine because I could have sworn I was using an apostrophe/single quote in the hostname this whole time. The only thing that would have changed was finally getting the newest version of the csgoserver script. The one I was using before was still looking for dgibbs64, if that helps.
Author
Owner

@UltimateByte commented on GitHub (Oct 9, 2016):

Error reproduced on a gmod server, confirmed.
Every source game is concerned, maybe more.
If you put two single quotes the error doesn't happen.

Key to fix it : So the best way would be to set this variable in a way that accepts single quotes... Can't think of one for now, would need some research. Or, using a special sed as suggested.

The only thing that would have changed was finally getting the newest version of the csgoserver script.

Nope, as you said previously, it's not csgoserver itself but info_config.sh. Unless you're talking about a very old time where everything was contained into one single script. :p

<!-- gh-comment-id:252482542 --> @UltimateByte commented on GitHub (Oct 9, 2016): Error reproduced on a gmod server, confirmed. Every source game is concerned, maybe more. If you put two single quotes the error doesn't happen. Key to fix it : So the best way would be to set this variable in a way that accepts single quotes... Can't think of one for now, would need some research. Or, using a special sed as suggested. > The only thing that would have changed was finally getting the newest version of the csgoserver script. Nope, as you said previously, it's not csgoserver itself but info_config.sh. Unless you're talking about a very old time where everything was contained into one single script. :p
Author
Owner

@cedarlug commented on GitHub (Oct 9, 2016):

Try adding -e 's/0x27/\\\'/g'into the expression (if you want to preserve the tick/apostrophe).

(This is off the top of my head - I'll check to see what that does here in a moment.)

<!-- gh-comment-id:252485282 --> @cedarlug commented on GitHub (Oct 9, 2016): Try adding `-e 's/0x27/\\\'/g'`into the expression (if you want to preserve the tick/apostrophe). (This is off the top of my head - I'll check to see what that does here in a moment.)
Author
Owner

@cedarlug commented on GitHub (Oct 9, 2016):

Are either/both of you getting a message about xargs with the single tick? If so, I think that I have the global fix.

<!-- gh-comment-id:252485640 --> @cedarlug commented on GitHub (Oct 9, 2016): Are either/both of you getting a message about xargs with the single tick? If so, I think that I have the global fix.
Author
Owner

@hatbocs commented on GitHub (Oct 9, 2016):

The quote I had in the first post was exactly what the script was spitting out to console when I first reported the issue (before attempting to fix). So in short, yes.

<!-- gh-comment-id:252485820 --> @hatbocs commented on GitHub (Oct 9, 2016): The quote I had in the first post was exactly what the script was spitting out to console when I first reported the issue (before attempting to fix). So in short, yes.
Author
Owner

@cedarlug commented on GitHub (Oct 9, 2016):

./csgoserver uf
sed -i 's/xargs)$/xargs -0)/g' lgsm/functions/info_config.sh
./csgoserver details

Please try.

<!-- gh-comment-id:252485854 --> @cedarlug commented on GitHub (Oct 9, 2016): ``` bash ./csgoserver uf sed -i 's/xargs)$/xargs -0)/g' lgsm/functions/info_config.sh ./csgoserver details ``` Please try.
Author
Owner

@cedarlug commented on GitHub (Oct 9, 2016):

Oh - but if you edited the file first, then probably the full shabang is necessary:

rm lgsm/functions/info_config.sh                             #remove existing version
./csgoserver details 2>&1 > /dev/null                        # forces it to be re-downloaded
sed -i 's/xargs)$/xargs -0)/g' lgsm/functions/info_config.sh #fixes the pristine source
./csgoserver details                                         # All good?
<!-- gh-comment-id:252486028 --> @cedarlug commented on GitHub (Oct 9, 2016): Oh - but if you edited the file first, then probably the full shabang is necessary: ``` bash rm lgsm/functions/info_config.sh #remove existing version ./csgoserver details 2>&1 > /dev/null # forces it to be re-downloaded sed -i 's/xargs)$/xargs -0)/g' lgsm/functions/info_config.sh #fixes the pristine source ./csgoserver details # All good? ```
Author
Owner

@hatbocs commented on GitHub (Oct 9, 2016):

Worked for me.

Now to figure out why rcon won't gracefully quit. And why my server doesn't show up in the server browser.

<!-- gh-comment-id:252486900 --> @hatbocs commented on GitHub (Oct 9, 2016): Worked for me. Now to figure out why rcon won't gracefully quit. And why my server doesn't show up in the server browser.
Author
Owner

@UltimateByte commented on GitHub (Oct 9, 2016):

@hatbocs Start by watching your console logs. Those two errors (graceful and not showing up) might be related. I bet on a GSLT issue.

<!-- gh-comment-id:252487163 --> @UltimateByte commented on GitHub (Oct 9, 2016): @hatbocs Start by watching your console logs. Those two errors (graceful and not showing up) might be related. I bet on a GSLT issue.
Author
Owner

@hatbocs commented on GitHub (Oct 9, 2016):

Of course, the logs! For some reason I didn't look through them. And there's a segmentation fault as it's starting the server. I'll have to tackle that one later on today.

Thanks for the help @UltimateByte and @cedarlug

<!-- gh-comment-id:252488108 --> @hatbocs commented on GitHub (Oct 9, 2016): Of course, the logs! For some reason I didn't look through them. And there's a segmentation fault as it's starting the server. I'll have to tackle that one later on today. Thanks for the help @UltimateByte and @cedarlug
Author
Owner

@UltimateByte commented on GitHub (Oct 9, 2016):

@hatbocs If you're using sourcemod/metamod, the last csgo update broke it. You need to update your addons. Watch out your config files, don't overwrite them. :)

<!-- gh-comment-id:252491150 --> @UltimateByte commented on GitHub (Oct 9, 2016): @hatbocs If you're using sourcemod/metamod, the last csgo update broke it. You need to update your addons. Watch out your config files, don't overwrite them. :)
Author
Owner

@UltimateByte commented on GitHub (Oct 9, 2016):

Merged, we can close now.
To get the update : ./gameserver uf
Thanks for reporting.

<!-- gh-comment-id:252501051 --> @UltimateByte commented on GitHub (Oct 9, 2016): Merged, we can close now. To get the update : ./gameserver uf Thanks for reporting.
Author
Owner

@hatbocs commented on GitHub (Oct 9, 2016):

Awesome, thanks for the heads up.

<!-- gh-comment-id:252501358 --> @hatbocs commented on GitHub (Oct 9, 2016): Awesome, thanks for the heads up.
Author
Owner

@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.

<!-- gh-comment-id:406154663 --> @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.
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#875
No description provided.