Page 1 of 1

Use LD_LIBRARY_PATH - Headless Server

Posted: Sun Mar 12, 2017 2:35 pm
by DrunknSailor_Thasl
I tried to get the Factorio Headless Server running on a CentOS 6.8 (it's a shared hoster so I can't change that...).
When I try to start the server, the following errors occur:

Code: Select all

./factorio --start-server savegame.zip
./factorio: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./factorio)
./factorio: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./factorio)
./factorio: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./factorio)
I believe I found the problem, because Factorio searches for the libraries in the standard directories, where I can't install anything:

Code: Select all

> ldd ./factorio
./factorio: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./factorio)
./factorio: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./factorio)
./factorio: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./factorio)
        linux-vdso.so.1 =>  (0x00007ffcd04fe000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fac53b3a000)
        librt.so.1 => /lib64/librt.so.1 (0x00007fac53931000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fac5372d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fac534a9000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fac53292000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fac52efe000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fac53d65000)
I did install GLIBC_2.25, but in another directory (where Factorio won't search for the libraries),because I don't have access to /lib.
Is there a workaround or a possibility to use the LD_LIBRARY_PATH variable (that points to where I can build) or to change the hard-coded path in the game?

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Tue Mar 14, 2017 5:56 pm
by christianh95
Hey together!

I got the exact same problem, would be great if the path would be customizable!

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Tue Mar 14, 2017 5:58 pm
by torne
I think you're misinterpreting ldd's output here - the game is searching for libc.so.6 (not a hardcoded path) and ldd is simply finding /lib64/libc.so.6 according to the current linker settings. There's no reason visible here why it shouldn't respect LD_LIBRARY_PATH just fine. If you set LD_LIBRARY_PATH correctly and then run ldd, what do you see?

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Tue Mar 14, 2017 8:23 pm
by christianh95
Hi, Torne!

My LD_LIBRARY_PATH is set correctly

Code: Select all

> $ echo $LD_LIBRARY_PATH
/home/user/.toast/pkg
Where you find

Code: Select all

> $ ls /home/user/.toast/pkg
glibc
but the output is still

Code: Select all

> $ ldd ./factorio
./factorio: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./factorio)
./factorio: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./factorio)
./factorio: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./factorio)
        linux-vdso.so.1 =>  (0x00007ffc04778000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f278f42d000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f278f224000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f278f020000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f278ed9c000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f278eb85000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f278e7f1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f278f658000)

so factorio is obviously not consider the Env variable. You got an idea?

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Tue Mar 14, 2017 9:04 pm
by torne
You need to point LD_LIBRARY_PATH at a directory which contains a file called exactly "libc.so.6". It doesn't search subdirectories.

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Tue Mar 14, 2017 9:20 pm
by christianh95
Okay, that is good to know! I'll try it asap! Thanks!

Re: Use LD_LIBRARY_PATH - Headless Server

Posted: Wed Mar 15, 2017 2:04 pm
by mexmer
from this
libc.so.6 => /lib64/libc.so.6 (0x00007f278e7f1000)

you can tell, that library is present, but library is not in version, that is required by factorio

download version 2.15 or 2.14 from here

https://ftp.gnu.org/gnu/libc/

and put it in any folder, that will be in LD_LIBRARY_PATH

when i have apps, that require different version of library, than one installed in system, i usualy install them int /usr/opt/lib/libraryname-version/

and add such path to script that sets LD_LIBRARY_PATH and launches app.