[GH-ISSUE #275] Suggestion: Use "unbuffer" to get by pipe buffer #233

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

Originally created by @tenpin784 on GitHub (Jan 25, 2015).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/275

When downloading a game, the buffer of the tee command makes it appear that the download has frozen. By adding unbuffer (from the expect package), it makes it so the status lines are printed out as they happen.

In functions/fn_install_serverfiles:


unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_install_serverfiles.tmp

unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp

unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp


Just a thought.

--John

Originally created by @tenpin784 on GitHub (Jan 25, 2015). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/275 When downloading a game, the buffer of the tee command makes it appear that the download has frozen. By adding unbuffer (from the expect package), it makes it so the status lines are printed out as they happen. In functions/fn_install_serverfiles: --- unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_install_serverfiles.tmp unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp unbuffer ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp --- Just a thought. --John
kerem 2026-02-27 02:00:18 +03:00
Author
Owner

@dgibbs64 commented on GitHub (Jan 25, 2015):

NIce suggestion. I will be implementing this idea. Thanks

<!-- gh-comment-id:71398726 --> @dgibbs64 commented on GitHub (Jan 25, 2015): NIce suggestion. I will be implementing this idea. Thanks
Author
Owner

@dgibbs64 commented on GitHub (Jan 26, 2015):

Looked at this however you have to install another package to get this to work and when I did the command still wasn't available in ubuntu or debian. Are there other options that are more compatible?

<!-- gh-comment-id:71447314 --> @dgibbs64 commented on GitHub (Jan 26, 2015): Looked at this however you have to install another package to get this to work and when I did the command still wasn't available in ubuntu or debian. Are there other options that are more compatible?
Author
Owner

@tenpin784 commented on GitHub (Jan 27, 2015):

Did you install expect, or expect-dev?

From what I have read, in Ubuntu its in expect-dev.
On Jan 26, 2015 5:26 AM, "Daniel Gibbs" notifications@github.com wrote:

Looked at this however you have to install another package to get this to
work and when I did the command still wasn't available in ubuntu or debian.
Are there other options that are more compatible?


Reply to this email directly or view it on GitHub
https://github.com/dgibbs64/linuxgameservers/issues/275#issuecomment-71447314
.

<!-- gh-comment-id:71593869 --> @tenpin784 commented on GitHub (Jan 27, 2015): Did you install expect, or expect-dev? From what I have read, in Ubuntu its in expect-dev. On Jan 26, 2015 5:26 AM, "Daniel Gibbs" notifications@github.com wrote: > Looked at this however you have to install another package to get this to > work and when I did the command still wasn't available in ubuntu or debian. > Are there other options that are more compatible? > > — > Reply to this email directly or view it on GitHub > https://github.com/dgibbs64/linuxgameservers/issues/275#issuecomment-71447314 > .
Author
Owner

@dgibbs64 commented on GitHub (Jan 29, 2015):

that would be the issue then. I will look at writing this in as an optional. If the server happens to have it installed then it would use it. If not it wont.

<!-- gh-comment-id:72118481 --> @dgibbs64 commented on GitHub (Jan 29, 2015): that would be the issue then. I will look at writing this in as an optional. If the server happens to have it installed then it would use it. If not it wont.
Author
Owner

@tenpin784 commented on GitHub (Jan 29, 2015):

Was thinking that too.

something like unbuffer=which unbuffer

if $unbuffer == '' then dont use it.

something like that?
On 01/29/2015 04:35 PM, Daniel Gibbs wrote:

that would be the issue then. I will look at writing this in as an
optional. If the server happens to have it installed then it would use
it. If not it wont.


Reply to this email directly or view it on GitHub
https://github.com/dgibbs64/linuxgameservers/issues/275#issuecomment-72118481.

<!-- gh-comment-id:72119263 --> @tenpin784 commented on GitHub (Jan 29, 2015): Was thinking that too. something like unbuffer=`which unbuffer` if $unbuffer == '' then dont use it. something like that? On 01/29/2015 04:35 PM, Daniel Gibbs wrote: > that would be the issue then. I will look at writing this in as an > optional. If the server happens to have it installed then it would use > it. If not it wont. > > — > Reply to this email directly or view it on GitHub > https://github.com/dgibbs64/linuxgameservers/issues/275#issuecomment-72118481.
Author
Owner

@dgibbs64 commented on GitHub (Jan 29, 2015):

yep thats what I have planned :). Won't take look long to implement either

<!-- gh-comment-id:72120305 --> @dgibbs64 commented on GitHub (Jan 29, 2015): yep thats what I have planned :). Won't take look long to implement either
Author
Owner

@ilijamt commented on GitHub (Apr 7, 2015):

You have a similar command in Linux it's part of the coreutils so it will be present on every system.

The command is stdbuf, take a look at http://linux.die.net/man/1/stdbuf

So for the case above to work you would do it like this.

stdbuf -o 0 <command> | tee <log_file>
<!-- gh-comment-id:90544648 --> @ilijamt commented on GitHub (Apr 7, 2015): You have a similar command in Linux it's part of the coreutils so it will be present on every system. The command is stdbuf, take a look at http://linux.die.net/man/1/stdbuf So for the case above to work you would do it like this. ``` stdbuf -o 0 <command> | tee <log_file> ```
Author
Owner

@dgibbs64 commented on GitHub (Apr 15, 2015):

Thanks for that @ilijamt I will investigate.

<!-- gh-comment-id:93578401 --> @dgibbs64 commented on GitHub (Apr 15, 2015): Thanks for that @ilijamt I will investigate.
Author
Owner

@dgibbs64 commented on GitHub (May 5, 2015):

Tried sdbuff got the following error

ERROR: ld.so: object '/usr/lib/coreutils/libstdbuf.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
<!-- gh-comment-id:99011916 --> @dgibbs64 commented on GitHub (May 5, 2015): Tried sdbuff got the following error ``` ERROR: ld.so: object '/usr/lib/coreutils/libstdbuf.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. ```
Author
Owner

@dgibbs64 commented on GitHub (May 5, 2015):

I have now implemented unbuffer that will run if available on the distro.

github.com/dgibbs64/linuxgsm@044d5f5aec

<!-- gh-comment-id:99015538 --> @dgibbs64 commented on GitHub (May 5, 2015): I have now implemented unbuffer that will run if available on the distro. https://github.com/dgibbs64/linuxgsm/commit/044d5f5aec232fd6451219fc45a426123ae1a7f1
Author
Owner

@ilijamt commented on GitHub (May 5, 2015):

ERROR: ld.so: object '/usr/lib/coreutils/libstdbuf.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

This is an error with the files installed it's trying to load 32 bit but it's loading 64 bit.
This is some error with your distribution.

<!-- gh-comment-id:99015774 --> @ilijamt commented on GitHub (May 5, 2015): ``` ERROR: ld.so: object '/usr/lib/coreutils/libstdbuf.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. ``` This is an error with the files installed it's trying to load 32 bit but it's loading 64 bit. This is some error with your distribution.
Author
Owner

@dgibbs64 commented on GitHub (May 5, 2015):

Makes sense as im running 64-bit but ./steamcmd.sh is 32-bit.

<!-- gh-comment-id:99015935 --> @dgibbs64 commented on GitHub (May 5, 2015): Makes sense as im running 64-bit but ./steamcmd.sh is 32-bit.
Author
Owner

@dgibbs64 commented on GitHub (May 5, 2015):

The only way to implement stdbuf would be to detect if a 32-bit version is installed and use that. otherwise it will just not use it.

<!-- gh-comment-id:99016118 --> @dgibbs64 commented on GitHub (May 5, 2015): The only way to implement stdbuf would be to detect if a 32-bit version is installed and use that. otherwise it will just not use it.
Author
Owner

@ilijamt commented on GitHub (May 5, 2015):

I tried it on 64-bit OS, on my system and it's running without an issue, with stdbuf.

<!-- gh-comment-id:99016145 --> @ilijamt commented on GitHub (May 5, 2015): I tried it on 64-bit OS, on my system and it's running without an issue, with stdbuf.
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:406430573 --> @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#233
No description provided.