install.sh enviroment needs to be documented.

0

There's a severe lack of documentation about the environment in which install.sh runs. It would be nice if https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-packaging.html would be updated with information.

Things I've had to figure out on my own:

  • install.sh is run explicitly as sh install.sh, ie: any #!/bin/bash is ignored, so don't expect bash features unless you explicitly create an additional bash script and just call it from install.sh.

  • Files extracted from your build are not writeable by the invoking user, so your script will probably need a lot of calls through sudo in it. This is also true of the executable you specify in the fleet config to run for each game server instance. eg: UE4's wrapper script tries to chmod +x the actual executable, which will fail unless you modify the script to sudo chmod +x.

  • Files installed are owned by gl-user-server with gl-user as the group. Open questions of mine that remain:

  • What's the actual user that runs the install.sh script and the game server executable specified by the fleet? This would be helpful in making permissions decisions such as: can I just g+w a directory that logs go into, or do I have to go full on a+w?

asked 7 years ago498 views
24 Answers
0

Thanks for thee feedback @REDACTEDUSER

answered 7 years ago
0

It would be nice to have some updates about this issue. Thank you!

answered 4 years ago
0

The documentation about the install script has been updated: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-install

Please let us know if anything is still unclear

Thank you

answered 4 years ago
0

I solved my problem. Thanks Dajun!

answered 4 years ago
0

Hi, can you post a default example of the install.sh as required by the server? Basically, I just need a log.

answered 2 years ago
0

[quote="chrisgong, post:7, topic:4357"]

#!/bin/bash
echo 'Hello World' > install.log

[/quote] Hi.

But if I do not provide an install.sh the GameLift Fleet fails with: "/local/game/install.sh is empty or does not exist."

answered 2 years ago
0

In this case, I would suggest creating an install.sh file, using Visual Studio Code to make it easier, add the sample code inside for now,

#!/bin/bash
echo 'Hello World' > install.log

and then add it to the root level of the game directory that you're uploading to GameLift. If your server fails to run because of some missing software dependency issue, then you may have to modify the install.sh file with some yum install commands in your install.sh script.

answered 2 years ago
0

In the link referenced, there is a sample install.sh file

#!/bin/bash
echo 'Hello World' > install.log

However, I have found more recently that Unreal Engine servers don't need an install.sh script. That may have changed but if they do, I don't believe the server needs anything to be installed in the Amazon Linux environment of the ec2 instances in the fleet in order to run successfully, so that may be why their sample script doesn't include any install commands. However, this may not hold true for other kinds of game servers, for e.g. Unity, non-custom game servers, etc.

If your server does have some software dependencies that need to be installed before running, then you'll have to include some yum install commands in your install.sh script.

answered 2 years ago
0

Okay, it might have failed because at least under Windows I have to install the following (see 1st answer) https://answers.unrealengine.com/questions/248909/what-gets-installed-with-ue4prereqsetup-x64exe.html

Looking now for a file to install the same as with UE4PrereqSetup_x64.exe

Related https://forums.awsgametech.com/t/unreal-linux-dependencies/6631

answered 2 years ago
0

This simple install.sh works for me

#!/bin/bash

answered 2 years ago
0

The error now is this

Server process exited without calling ProcessEnding(), exitCode(127)

The error means a command is missing.

Found this Linux Server (via https://forums.awsgametech.com/t/how-to-correctly-prepare-linux-executables/1370/14), which appears to include the required files. https://github.com/zeliard/GameLift/tree/master/GameLiftLinuxServer

However, does someone know how I can extract the required files for my build? Build it first?

answered 2 years ago
0

I would suggest remote connecting into an instance in your fleet to check the server logs to see why the server is crashing.

answered 2 years ago
0

I still have this problem but the error

Cannot run program "/local/game/install.sh" (in directory "/local/game"): error=2, No such file or directory

Prevents GameLift Fleet from creating an Instance. How can I access this error log? I have tried the following install.sh (created in Visual Studio 2019).

#!/bin/bash chmod +x ./GameName/Binaries/Linux/GameNameServer sudo -u gl-user-server ln -sf ./GameName/Saved/Logs ./logs

or

#!/bin/bash

or no install.sh

answered 2 years ago
0

There is no log, because the install is aborted prior to creating a game instance.

answered 2 years ago
0

Using this Tutorial to setup Linux Server, at the end is install.sh code. https://www.youtube.com/watch?v=E5XNvFCobuE Still fails with the same error:

Cannot run program “/local/game/install.sh” (in directory “/local/game”): error=2, No such file or directory

Above error is misleading, install.sh is present at the correct directory. Thus, this appears to be a AWS GameLift bug.

answered 2 years ago
0

What command are you using to upload the server build?

answered 2 years ago
0

aws gamelift upload-build --name GameNameServer --build-version 1.0 --build-root c:\STAGE\SERVER\LinuxServer --operating-system AMAZON_LINUX --region eu-central-1

I can create a Windows build np.

answered 2 years ago
0

What does the directory structure of c:\STAGE\SERVER\LinuxServer look like?

answered 2 years ago
0

This is the default Unreal Engine folder structure (server build target).

Root files: install.sh GameNameServer.sh Manifest_DebugFiles_Linux.txt Manifest_NonUFSFiles_Linux.txt Manifest_UFSFiles_Linux.txt

Folders: Engine GameName

answered 2 years ago
0

I think your install.sh file is formatted incorrectly and as a result it can't be read. Check the line endings on your shell file. There might be carriage return line feed characters (CRLF) if you're on Windows whereas lines in Linux files should end in only line feed characters (LF). If you create the shell script in Visual Studio Code, then that should solve it, assuming you're developing on Windows originally.

answered 2 years ago
0

I opened the install.sh inside VS 2019, removed any spaces and cut/pasted all lines again, still after upload and setting up a fleet, same result.

answered 2 years ago
0

Hi @REDACTEDUSER

2 suggestions:

  1. Create a new fleet, wait for it to go into ERROR, then SSH to your erred fleet using GetInstanceAccess (see: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html), then, run sudo su to acquire root access, and ls /local/game to see if install.sh is there. If so, run less /local/game/install.sh to see if you can see any abnormalities.
  2. Try compress your server files into a zip by yourself. Ensure that it can extract to include install.sh in the root. Then, upload the build to S3 and create a build that way: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html

If these do not work, let us know your region and buildId, and we can take a look for you.

answered 2 years ago
0

Thanks for your suggestion but the error is prior to the creation of an instance. I did not tried to upload a zip yet - in case I continue this very expensive adventure to try setting up GameLift I will consider your suggestion with uploading zipped server files.

answered 2 years ago
0

In your AWS GameLift console's fleet events, you should get the error logs if install script fails, (though in this case, your install script wasn't even run,) Could you check your fleet events to see if there are anything else suspicious?

You might know this already, but just FYI that gamelift currently has a free tier which includes 125 hours of c5.large per month (see: https://aws.amazon.com/gamelift/pricing/). Also, you can use SPOT fleets to cut down your costs, and the only downside is that there could be a small chance of instance interruption during your development.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions