Suggestion: Use "unbuffer" to get by pipe buffer
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
NIce suggestion. I will be implementing this idea. Thanks
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?
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" [email protected] 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 .
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.
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.
yep thats what I have planned :). Won't take look long to implement either
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>
Thanks for that @ilijamt I will investigate.
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.
I have now implemented unbuffer that will run if available on the distro.
https://github.com/dgibbs64/linuxgsm/commit/044d5f5aec232fd6451219fc45a426123ae1a7f1
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.
Makes sense as im running 64-bit but ./steamcmd.sh is 32-bit.
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.
I tried it on 64-bit OS, on my system and it's running without an issue, with stdbuf.
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.