Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

Commit

Permalink
Fix srcds_run crash with error message 'cat: hlds.{PID}.pid: No such …
Browse files Browse the repository at this point in the history
…file or directory'

Multiple causes:
* Pin to **18.04** not **latest**. Latest auto upgraded to Ubuntu 20.04. 20.04
  currently segfaults steamcmd.
* Targeted pruning of **/var/lib/dpkg** instead of wiping. amd64/i386 repos now
  enabled on Docker startup, enabling updates for both.
* Add explicit requirements for **GDB** and **c++6**; enabling `-debug` option
  for `srcds_run` which prevents PID error and auto reboot every 10 seconds.
  See: https://forums.alliedmods.net/showthread.php?t=300118
* **wine 5.x** added requirement of libfaudio0, but not included for version of
  Ubuntu < 19.10. Install these manually.

Changes:
* `steam` -> `stable`.
* `winehq` -> `latest`.
  • Loading branch information
r-pufky committed May 24, 2020
1 parent 2dc9976 commit fbb78e8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Dockerfile/BASE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# steam dedicated server for docker.
# https://developer.valvesoftware.com/wiki/SteamCMD#Linux.2FOS_X

FROM ubuntu:latest
FROM ubuntu:18.04

ENV SERVER_DIR=/data/server \
STEAM=/steam \
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile/CLEANUP
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Clean up target host system caches.
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rfv /var/lib/{apt,dpkg} /var/lib/{cache, log} /tmp/* /var/tmp/*
rm -rfv /var/lib/{apt,dpkg} /var/lib/{cache,log} /tmp/* /var/tmp/* && \
mkdir -p /var/lib/dpkg/{alternatives,info,parts,updates} && \
touch /var/lib/dpkg/status && \
echo -e 'amd64\ni386' > /var/lib/dpkg/arch
15 changes: 15 additions & 0 deletions Dockerfile/INSTALL_STEAM
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Auto-accept license and install steamcmd.
echo steam steam/license note '' | debconf-set-selections && \
echo steam steam/question select 'I AGREE' | debconf-set-selections && \
dpkg --add-architecture i386 && \
apt-get --quiet update && \
apt-get --quiet --yes upgrade && \
# Ensure packages required by srcds_run installed to prevent 'cat: hlds.{PID}.pid: No such file or directory' errors.
# See: https://forums.alliedmods.net/showthread.php?t=300118
apt-get install --yes --install-recommends \
lib32z1 \
lib32gcc1 \
lib32ncurses5 \
libbz2-1.0 \
libbz2-1.0:i386 \
lib32stdc++6 \
libstdc++6:i386 \
libcurl4-gnutls-dev \
libcurl4-gnutls-dev:i386 && \
apt-get install --yes --install-recommends \
steamcmd && \
15 changes: 15 additions & 0 deletions Dockerfile/WINEHQ
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@ dpkg --add-architecture i386 && \
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' && \
apt-get --quiet update && \
# Wine 5.x+ requires libfaudio0, but not included on Ubuntu < 19.10.
# https://forum.winehq.org/viewtopic.php?f=8&t=32192
# https://askubuntu.com/questions/1100351/broken-packages-fix-problem-for-wine
apt-get install --yes --install-recommends \
libsdl2-2.0-0 \
libsdl2-2.0-0:i386 \
libc6 \
libc6:i386 && \
wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/amd64/libfaudio0_19.07-0~bionic_amd64.deb -O /tmp/libfaudio0_19.07-0~bionic_amd64.deb && \
wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/i386/libfaudio0_19.07-0~bionic_i386.deb -O /tmp/libfaudio0_19.07-0~bionic_i386.deb && \
dpkg -i /tmp/libfaudio0_19.07-0~bionic_amd64.deb /tmp/libfaudio0_19.07-0~bionic_i386.deb && \

apt-get --quiet --yes upgrade && \
apt-get install --yes --install-recommends \
lib32gcc1 \
winehq-stable \
supervisor \
xvfb && \



22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ D_DIR = Dockerfile
help:
@echo 'USAGE:'
@echo
@echo 'make steam'
@echo 'make stable'
@echo ' Build latest steam dedicated docker container.'
@echo
@echo 'make winehq'
@echo ' Build latest steam dedicated docker with winehq repo container.'
@echo 'make latest'
@echo ' Build latest steam dedicated docker with latest winehq stable updates container.'
@echo
@echo 'make all'
@echo ' Build all latest containers.'

.PHONY: help Makefile

all: steam winehq
all: stable latest

steam: clean
stable: clean
@echo 'Building steam ubuntu container ...'
@mkdir -p $(STAGING_DIR)
@cp ${D_DIR}/BASE ${STAGING_DIR}/Dockerfile
Expand All @@ -35,13 +35,13 @@ steam: clean
@cp -R source $(STAGING_DIR)
@cd $(STAGING_DIR) && \
docker build \
-t rpufky/steam:latest \
-t rpufky/steam:stable \
.
@echo
@echo 'Remember to push to hub: docker push rpufky/steam:latest'
@echo 'Remember to push to hub: docker push rpufky/steam:stable'

winehq: clean
@echo 'Building steam ubuntu container using winehq repo ...'
latest: clean
@echo 'Building steam ubuntu container using wine stable latest from winehq repo ...'
@mkdir -p $(STAGING_DIR)
@cp ${D_DIR}/BASE ${STAGING_DIR}/Dockerfile
@cat ${D_DIR}/LOCALE_BASE >> ${STAGING_DIR}/Dockerfile
Expand All @@ -57,10 +57,10 @@ winehq: clean
@cp -R source $(STAGING_DIR)
@cd $(STAGING_DIR) && \
docker build \
-t rpufky/steam:winehq \
-t rpufky/steam:latest -t rpufky/steam:winehq \
.
@echo
@echo 'Remember to push to hub: docker push rpufky/steam:winehq'
@echo 'Remember to push to hub: docker push rpufky/steam:latest'


clean:
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ After launching the container:

## Version Tags

| Tag | Description |
|--------|------------------------------------------------------------------------|
| latest | Latest ubuntu image with wine and steamcmd. |
| winehq | Latest ubuntu image with latest wine packages (unstable) and steamcmd. |
| Tag | Description |
|--------|------------------------------------------------------------------------------------|
| stable | Ubuntu 18.04 with wine and steamcmd from binary repo. |
| latest | Ubuntu 18.04 with latest winehq stable packages and steamcmd. This **WILL** break. |

## Parameters

Expand Down Expand Up @@ -168,13 +168,12 @@ su steam -c 'your server launch command'
> Check dedicated server documentation for that game.
### Linux Example
This will launch a linux dedicated server, assuming that the linux server is
launched via a `startserver.sh` script in the install directory.
This will launch a **Left 4 Dead** ``srcsd_run`` linux dedicated server.

```
su steam -c "/data/server/startserver.sh -configfile=/data/server/serverconfig.xml"
su steam -c "/data/server/srcds_run -console -game left4dead -map l4d_hospital01_apartment -port 27015 +maxplayers 4 -nohltv +exec /data/server.cfg"
```
* this example would launch a 7 days to die dedicated server (294420).
* this example would launch a Left 4 Dead dedicated server (222840).

### Windows Example
All flavors of wine are installed (wind, wine32 and wine64). Check specific
Expand Down

0 comments on commit fbb78e8

Please sign in to comment.