C# Server on Amazon Linux Server

Hello, we’ve got a C# executable for our game server that works great with GameLiftLocal, but we’d like to deploy to an Amazon Linux GameLift fleet rather than a Windows one. The server runs great with Mono, and I’ve written an install.sh that installs the mono runtime, but that means that our server needs to be invoked as “mono /local/game/GameService.exe” rather than “/local/game/GameService.exe”.

I initially tried to work around this my making a “GameService.sh” in “/local/game” that just did “mono GameService.exe” and that caused the service to start up successfully, but that just causes GameLift to give an error of “A process unrecognized by GameLift is attempting to make GameLift Server SDK API calls. Are you using a process launcher?”

Is there a way to get this to work with GameLift?

Hi @Nakano37

Looks like you are getting really close of having your application run properly on Linux.
I believe the right approach for this to work would be to leverage mkbundle. With this utility, you should be able to package your application as a standalone. This has the advantage of not having to install the whole Mono runtime with the install.sh and it’ll will allow you to run your application on GameLift without using a shell script.

Now, I don’t know a lot about your build environment and I am going to assume you are building with Mono on Linux. Here’s an example of a command that I would use to bundle up an application:

mkbundle -o MyGameServiceStandAlone GameServerExecutableApplication lib1.so lib2.so lib3.so --deps --static --config myconfigfile -L /usr/lib/mono/<Your version of mono>

This should give you a single executable file ‘MyGameServiceStandAlone’ that encompasses your application ‘GameServerExecutableApplication’ with all the libraries required for it to run. Keep in mind that you will have to give it all the libraries required by your application, including all the GameLift’s dependencies.
I invite you to play around with mkbundle and figure out the proper command for your application, but this should give you a good place to start.

Would you mind giving this a try and see if it works out for you?

Hope this helps!

Alexis

P.S. Amazon Linux images sometime have older versions of libc and so if you run into failures to bootstrap your application you’ll want to use custom configuration files when bundling it up. For example:

        <configuration>
<dllmap dll="libc" target="libc.so.6" os="!windows"/>
</configuration>