[0.12] [Oxyd] Headless mode is unusable
[0.12] [Oxyd] Headless mode is unusable
Hi
So the "headless mode" is pretty much unusable for 0.12 on Linux (probably your #1 target for a headless install). The list of libraries required by the factorio binary is prohibitive on most headless environments
(also, you require a very new version of libc by the looks of things - certainly not very compatible).
ldd ./bin/x64/factorio
./bin/x64/factorio: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./bin/x64/factorio)
./bin/x64/factorio: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by ./bin/x64/factorio)
./bin/x64/factorio: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.15' not found (required by ./bin/x64/factorio)
linux-vdso.so.1 => (0x00007fffd7df1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f61c1000000)
libasound.so.2 => not found
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f61c0cc4000)
libXcursor.so.1 => not found
libXinerama.so.1 => not found
libXrandr.so.2 => not found
libXi.so.6 => not found
libGL.so.1 => not found
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f61c0aba000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f61c0838000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f61c0622000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f61c0296000)
/lib64/ld-linux-x86-64.so.2 (0x00007f61c1222000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f61c0076000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f61bfe72000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f61bfc6e000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f61bfa69000)
Most of those libs are not going to be found and are probably not going to be easily installable on a headless server.
My suggestion is to make a special "headless" binary, that has those lib dependencies stripped, somehow.
So the "headless mode" is pretty much unusable for 0.12 on Linux (probably your #1 target for a headless install). The list of libraries required by the factorio binary is prohibitive on most headless environments
(also, you require a very new version of libc by the looks of things - certainly not very compatible).
ldd ./bin/x64/factorio
./bin/x64/factorio: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./bin/x64/factorio)
./bin/x64/factorio: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by ./bin/x64/factorio)
./bin/x64/factorio: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.15' not found (required by ./bin/x64/factorio)
linux-vdso.so.1 => (0x00007fffd7df1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f61c1000000)
libasound.so.2 => not found
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f61c0cc4000)
libXcursor.so.1 => not found
libXinerama.so.1 => not found
libXrandr.so.2 => not found
libXi.so.6 => not found
libGL.so.1 => not found
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f61c0aba000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f61c0838000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f61c0622000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f61c0296000)
/lib64/ld-linux-x86-64.so.2 (0x00007f61c1222000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f61c0076000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f61bfe72000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f61bfc6e000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f61bfa69000)
Most of those libs are not going to be found and are probably not going to be easily installable on a headless server.
My suggestion is to make a special "headless" binary, that has those lib dependencies stripped, somehow.
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: [0.12] Headless mode is unusable
I'm using Ubuntu 14.04 and I get a much different error. The server starts up fine but the instant I connect the server crashes and gives this error.
http://pastebin.com/4VUS9aWq
http://pastebin.com/4VUS9aWq
Looking for a multiplayer server? Check out my servers Vanilla Server
Re: [0.12] Headless mode is unusable
What's the difficulty in installing these libraries? You don't need an actual working X server, just the libraries.
Re: [0.12] Headless mode is unusable
You assume that someone is able to install a bunch of X libraries onto a headless server. That's not a good thing. Most hosting services will never give you root, or anything like it, so you'll get what we pretty much have at forgecraft - little that involves client libs. I would rather keep it that way. So if you require a bunch of desktop libs, don't anticipate being able to work on a hosted environment anytime soon..
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: [0.12] Headless mode is unusable
What linux distro and version are you running. Also what command are you running to start the server? My ubuntu install is fairly fresh and I didn't manually install any of these libraries.cpw wrote:You assume that someone is able to install a bunch of X libraries onto a headless server. That's not a good thing. Most hosting services will never give you root, or anything like it, so you'll get what we pretty much have at forgecraft - little that involves client libs. I would rather keep it that way. So if you require a bunch of desktop libs, don't anticipate being able to work on a hosted environment anytime soon..
Looking for a multiplayer server? Check out my servers Vanilla Server
Re: [0.12] Headless mode is unusable
What we really anticipated was allowing people to run Factorio on their own machines or at least machines where they can install the necessary dependencies. Separate headless binary would be very nice, but tearing Allegro out of Factorio is no small task, so don't anticipate being able to run Factorio in your environment anytime soon either.
Re: [0.12] Headless mode is unusable
Understood, but it's not really a server only binary. It's a "lightweight UI-less" mode. You still need to have access to all the stuff a desktop has. I find it disappointing that you trail such a great new feature and then step back and say "yeah, actually, we're pretty much gonna still only work on desktops, so don't bother".Oxyd wrote:What we really anticipated was allowing people to run Factorio on their own machines or at least machines where they can install the necessary dependencies. Separate headless binary would be very nice, but tearing Allegro out of Factorio is no small task, so don't anticipate being able to run Factorio in your environment anytime soon either.
Forgecraft is running Debian Wheezy at present. We're hosted by the creeperhost guys - and I'd bet they'd love to add factorio to their portfolio of games.. As such, root is not a given, so I suspect that those enterprising individuals who would want to run this would have a real problem in such hosted environments. Ubuntu is a desktop distribution, I would fully expect it to install these libraries by default. For 99% of server installations, they're just a waste of disk space and clutter for the linker.NoPantsMcDance wrote:What linux distro and version are you running. Also what command are you running to start the server? My ubuntu install is fairly fresh and I didn't manually install any of these libraries.
Re: [0.12] Headless mode is unusable
No need to install stuff as root, just put those libs in some user-writable directory and point LD_LIBRARY_PATH at it.
(Not linking against unnecessary libs would be the nicer solution of course)
(Not linking against unnecessary libs would be the nicer solution of course)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: [0.12] Headless mode is unusable
Not sure what you mean by ubuntu being a desktop distribution when it has a server version. http://www.ubuntu.com/download/server regardless seems more of a problem with your host and not the factorio guys themselves.Forgecraft is running Debian Wheezy at present. We're hosted by the creeperhost guys - and I'd bet they'd love to add factorio to their portfolio of games.. As such, root is not a given, so I suspect that those enterprising individuals who would want to run this would have a real problem in such hosted environments. Ubuntu is a desktop distribution, I would fully expect it to install these libraries by default. For 99% of server installations, they're just a waste of disk space and clutter for the linker.
Looking for a multiplayer server? Check out my servers Vanilla Server
Re: [0.12] Headless mode is unusable
Linking against all that X stuff when it's not needed is an issue with Factorio.NoPantsMcDance wrote:regardless seems more of a problem with your host and not the factorio guys themselves.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: [0.12] Headless mode is unusable
I agree when it's not needed. I see no reason the host can't install those libs if you ask them though but that's just my thinking. I personally run a VPS and do everything myself .prg wrote:Linking against all that X stuff when it's not needed is an issue with Factorio.NoPantsMcDance wrote:regardless seems more of a problem with your host and not the factorio guys themselves.
Looking for a multiplayer server? Check out my servers Vanilla Server
Re: [0.12] Headless mode is unusable
That is correct, yes. Basically it is a replacement for the abomination that is this guide for previous versions.cpw wrote:Understood, but it's not really a server only binary. It's a "lightweight UI-less" mode.
Re: [0.12] Headless mode is unusable
Of course. I understand. I just don't want a half dozen random big fat libs on a low disk server, cluttering things up. And for others that don't have the linux skills, these are likely a significant challenge.NoPantsMcDance wrote:I agree when it's not needed. I see no reason the host can't install those libs if you ask them though but that's just my thinking. I personally run a VPS and do everything myself .prg wrote:Linking against all that X stuff when it's not needed is an issue with Factorio.NoPantsMcDance wrote:regardless seems more of a problem with your host and not the factorio guys themselves.
-
- Filter Inserter
- Posts: 478
- Joined: Fri Jul 17, 2015 6:56 pm
- Contact:
Re: [0.12] Headless mode is unusable
It's completely understandable. I just don't see them removing those libs from the requirements anytime soon but it would be nice. So far from my experience I haven't got headless to work yet. Would love to see if other linux distros or users have gotten it to work.cpw wrote:Of course. I understand. I just don't want a half dozen random big fat libs on a low disk server, cluttering things up. And for others that don't have the linux skills, these are likely a significant challenge.NoPantsMcDance wrote:I agree when it's not needed. I see no reason the host can't install those libs if you ask them though but that's just my thinking. I personally run a VPS and do everything myself .prg wrote:Linking against all that X stuff when it's not needed is an issue with Factorio.NoPantsMcDance wrote:regardless seems more of a problem with your host and not the factorio guys themselves.
Looking for a multiplayer server? Check out my servers Vanilla Server
-
- Fast Inserter
- Posts: 171
- Joined: Sun Feb 17, 2013 4:31 pm
- Contact:
Re: [0.12] Headless mode is unusable
I just want to bump this, since its the exact same error I'm getting (I'm on Ubuntu 14.04.2LTS as well)NoPantsMcDance wrote:I'm using Ubuntu 14.04 and I get a much different error. The server starts up fine but the instant I connect the server crashes and gives this error.
http://pastebin.com/4VUS9aWq
Re: [0.12] Headless mode is unusable
Heh. It's working for me. I grabbed the (quite large) laundry list of servers, and rewrote the libc6 pointer (because the server is debian wheezy) and it loaded up fine. You have to "--create <save>" first, then "--start-server <save>" if you're starting a new save game on the server, but I was able to connect from locally to my server instance...NoPantsMcDance wrote:It's completely understandable. I just don't see them removing those libs from the requirements anytime soon but it would be nice. So far from my experience I haven't got headless to work yet. Would love to see if other linux distros or users have gotten it to work.cpw wrote:Of course. I understand. I just don't want a half dozen random big fat libs on a low disk server, cluttering things up. And for others that don't have the linux skills, these are likely a significant challenge.NoPantsMcDance wrote:I agree when it's not needed. I see no reason the host can't install those libs if you ask them though but that's just my thinking. I personally run a VPS and do everything myself .prg wrote:Linking against all that X stuff when it's not needed is an issue with Factorio.NoPantsMcDance wrote:regardless seems more of a problem with your host and not the factorio guys themselves.
Re: [0.12] Headless mode is unusable
If you're concerned about bloat...
(might need to adjust the list of libs to be created)
Code: Select all
echo 'void*XOpenDisplay(){return 0;}int XInitThreads(){return 1;}' > x.c && cc -shared -o libX11.so.6 x.c && touch empty.c && for i in libXext.so.6 libXfixes.so.3 libXrender.so.1 libGL.so.1 libXcursor.so.1; do cc -shared -o $i empty.c; done
LD_LIBRARY_PATH=. ./factorio --start-server bla
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: [0.12] Headless mode is unusable
I like the idea, but to save time for anyone else who might be tempted to try this, it doesn't work (even after adding all the other missing libs to the list). The game has a null check for the return value of XOpenDisplay(), so it exits immediately after the call to XOpenDisplay() (see http://pastebin.com/S6Ntxgqp). As a longshot, I checked if they open the display connection, check it for null, but never actually use it in headless mode, but simply having XOpenDisplay() return 1 instead of 0 (predictably) causes a segfault as the game immediately tries dereferencing it. Making factorio work without xlib would likely require a pretty extensive binary patch.prg wrote:If you're concerned about bloat...
(might need to adjust the list of libs to be created)Code: Select all
echo 'void*XOpenDisplay(){return 0;}int XInitThreads(){return 1;}' > x.c && cc -shared -o libX11.so.6 x.c && touch empty.c && for i in libXext.so.6 libXfixes.so.3 libXrender.so.1 libGL.so.1 libXcursor.so.1; do cc -shared -o $i empty.c; done LD_LIBRARY_PATH=. ./factorio --start-server bla
EDIT: See below; this works fine as long as you start it with --start-server. (I hadn't actually tried this myself, I was reporting this here after spending a while yesterday trying to help someone else get it working, and didn't notice they were starting it incorrectly.) Sorry for the noise. I like the idea even better now, knowing it works
Last edited by krelbel on Wed Jul 29, 2015 9:44 pm, edited 1 time in total.
Re: [0.12][Oxyd] Headless mode is unusable
You need to use --start-server instead of --mp-load-game.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: [0.12] Headless mode is unusable
That fix was refined from Wall'o'text https://forums.factorio.com/forum/vie ... 53&t=14273prg wrote:If you're concerned about bloat...
(might need to adjust the list of libs to be created)Code: Select all
echo 'void*XOpenDisplay(){return 0;}int XInitThreads(){return 1;}' > x.c && cc -shared -o libX11.so.6 x.c && touch empty.c && for i in libXext.so.6 libXfixes.so.3 libXrender.so.1 libGL.so.1 libXcursor.so.1; do cc -shared -o $i empty.c; done LD_LIBRARY_PATH=. ./factorio --start-server bla
I'd suggest making a separate fake-libs directory instead of polluting factorio, though.
Code: Select all
mkdir fake-libs && cd fake-libs && echo 'void*XOpenDisplay(){return 0;}int XInitThreads(){return 1;}' > x.c && cc -shared -o libX11.so.6 x.c && touch empty.c && for i in libXext.so.6 libXfixes.so.3 libXrender.so.1 libGL.so.1 libXcursor.so.1; do cc -shared -o $i empty.c; done & cd ..
echo 'LD_LIBRARY_PATH=fake-libs ./factorio --start-server "$@"' >factorio-headless.sh
chmod a+x factorio-headless.sh
./factorio-headless.sh blah blah