zomboid-dedicated-server icon indicating copy to clipboard operation
zomboid-dedicated-server copied to clipboard

Fix steamcmd SEGFAULT without running the server as root

Open super-cooper opened this issue 1 year ago • 1 comments

Resolves an issue with steamcmd.sh encountering a SEGFAULT when running as a non-root user. The server is installed, updated, and managed by the root user, but ownership of the server's files are always relinquished back to the steam user after they are created or modified.

This is more of a band-aid solution, as it would definitely be better to rework the image in such a way that it is not a requirement to constantly chown files back to the steam user, and also to not run anything as root, but I figure this is a serviceable and minimally-invasive solution to get the image working for now.

The change modifies the image to be based off of the root variant of the steamcmd-minimal image, and then creates a steam user manually in the Dockerfile. The run_server.sh script is run as root, but the command to run the server is done as the steam user. As mentioned above, whenever files required by the server are created or modified (as root) by run_server.sh, their ownership is transferred back to the steam user.

super-cooper avatar Jun 04 '23 05:06 super-cooper

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Jun 04 '23 05:06 sonarqubecloud[bot]