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?