(I am disappointed with abandoning RHEL/Centos, but it's their game).
Edit 7 - CentOS7 glibc 2.18 factorio headless.
Edit 8 - typo fix. Removing exports per GodricSeer suggestion. Thanks!
Edit 9 - mention of executable-path
Edit 10 - 20190227 - Factorio 0.17.1 is out! Verified the same glibc 2.18 method is still valid.
Edit 11 - 20190926 -
Centos8 Released yesterday! glibc 2.28! We are saved! A test install with Factorio 0.17.69 starts up just fine with a stock install. Hooray!
I initially posted this with quick instructions on replacing the CentOS7 glibc with 2.18 - which is a very bad idea. I'll leave those instructions at the bottom, but they really shouldn't be used. After seeing that it was possible to get factorio 0.16.x working on centos7 with the wrong approach (replacing glibc), I started working on the right approach (side by side)
Side by Side glibc 2.18
Updated instructions for adding a side-by-side glibc 2.18 into /opt for you to use starting the factorio headless server on CentOS7/RHEL7:
Get your tools ready
Code: Select all
yum groupinstall "Development tools"
yum install glibc-devel.i686 glibc.i686
Now that you have your steel axe, layout the belts and get your materials.
Code: Select all
cd /tmp
wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar xvzf glibc-2.18.tar.gz
cd glibc-2.18
mkdir glibc-build
cd glibc-build
../configure --prefix='/opt/glibc-2.18'
Fix test script
fix line 179 of the test install script:
I like nano, use whatever text editor you like.
Code: Select all
nano +179 ../scripts/test-installation.pl
- change
- to
Assemble!
At this point, you have glibc 2.18 in the /opt/glibc-2.18 path without getting in the way of the system glibc.
Now you have to login as your factorio user and change your startup to use the new glibc.
Specify the ld-linux-x86.so.2 in the /opt structure to be used when you start factorio and give it an appropriate path and LD_LIBRARY_PATH to use.
Creating a blank map (modify the path to your factorio binary appropriately):
Code: Select all
PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2 /home/factorio/factorio/bin/x64/factorio --create /home/factorio/factorio/saves/newmap16.zip
Running the latest save (I had trouble with this on one of my pre-0.16 maps - I converted it from a local save and uploaded the updated version and it worked fine)
Code: Select all
PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2 /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
Looks good to me!
Code: Select all
[factorio@factorio ~]$ PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2 /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
0.000 2017-12-18 15:11:49; Factorio 0.16.6 (build 34439, linux64, headless)
0.000 Operating system: Linux
0.000 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--start-server-load-latest"
0.000 Read data path: /home/factorio/factorio/data
0.000 Write data path: /home/factorio/factorio [110368/113336MB]
0.000 Binaries path: /home/factorio/factorio/bin
0.005 System info: [CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz, 8 cores, RAM: 15804MB]
0.005 Running in headless mode
...
Note: Factorio will not auto-restart with this startup method if you are changing mods or auto-updating
Edit 20180209 - There was a
recent thread where this format was used for startup and it looks a little prettier:
Code: Select all
/opt/glibc-2.18/lib/ld-2.18.so --library-path /opt/glibc-2.18/lib ./bin/x64/factorio --create test.zip --executable-path ./bin/x64/factorio
---------
The Wrong Way
And here is the wrong way that just replaced the default glibc:
The following is a bad idea. Replacing glibc in /usr works at the moment, but will likely be broken or will break future OS updates (and will almost certainly break other things on the system that expects the older glibc; but if your system is *just* for factorio . . .). I would say 'use at your own risk', but there really isn't much risk here - this will eventually break things on your system. There's probably a nice side-by-side way of doing this that someone could improve on.
Replacing glibc 2.17 with 2.18 (this is going to break things eventually!)
Get your tools ready
Code: Select all
yum groupinstall "Development tools"
yum install glibc-devel.i686 glibc.i686
Now that you have your steel axe, layout the belts and get your materials.
Code: Select all
cd /tmp
wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar xvzf glibc-2.18.tar.gz
cd glibc-2.18
mkdir glibc-build
cd glibc-build
../configure --prefix='/usr'
Fix rotation
fix line 179 of the test install script:
I like nano, use whatever text editor you like.
Code: Select all
nano +179 ../scripts/test-installation.pl
- change
- to
Assemble!
Hooray!
Code: Select all
[factorio@factorio ~]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[factorio@factorio ~]$ /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
0.000 2017-12-17 17:11:58; Factorio 0.16.5 (build 34419, linux64, headless)
0.000 Operating system: Linux
0.000 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--start-server-load-latest"
0.000 Read data path: /home/factorio/factorio/data
0.000 Write data path: /home/factorio/factorio [110456/113336MB]
0.000 Binaries path: /home/factorio/factorio/bin
0.005 System info: [CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz, 8 cores, RAM: 15804MB]
0.005 Running in headless mode