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

Commit fbb78e8

Browse files
committed
Fix srcds_run crash with error message 'cat: hlds.{PID}.pid: No such 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`.
1 parent 2dc9976 commit fbb78e8

File tree

6 files changed

+53
-21
lines changed

6 files changed

+53
-21
lines changed

Dockerfile/BASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# steam dedicated server for docker.
22
# https://developer.valvesoftware.com/wiki/SteamCMD#Linux.2FOS_X
33

4-
FROM ubuntu:latest
4+
FROM ubuntu:18.04
55

66
ENV SERVER_DIR=/data/server \
77
STEAM=/steam \

Dockerfile/CLEANUP

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Clean up target host system caches.
22
apt-get clean autoclean && \
33
apt-get autoremove --yes && \
4-
rm -rfv /var/lib/{apt,dpkg} /var/lib/{cache, log} /tmp/* /var/tmp/*
4+
rm -rfv /var/lib/{apt,dpkg} /var/lib/{cache,log} /tmp/* /var/tmp/* && \
5+
mkdir -p /var/lib/dpkg/{alternatives,info,parts,updates} && \
6+
touch /var/lib/dpkg/status && \
7+
echo -e 'amd64\ni386' > /var/lib/dpkg/arch

Dockerfile/INSTALL_STEAM

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Auto-accept license and install steamcmd.
22
echo steam steam/license note '' | debconf-set-selections && \
33
echo steam steam/question select 'I AGREE' | debconf-set-selections && \
4+
dpkg --add-architecture i386 && \
5+
apt-get --quiet update && \
6+
apt-get --quiet --yes upgrade && \
7+
# Ensure packages required by srcds_run installed to prevent 'cat: hlds.{PID}.pid: No such file or directory' errors.
8+
# See: https://forums.alliedmods.net/showthread.php?t=300118
9+
apt-get install --yes --install-recommends \
10+
lib32z1 \
11+
lib32gcc1 \
12+
lib32ncurses5 \
13+
libbz2-1.0 \
14+
libbz2-1.0:i386 \
15+
lib32stdc++6 \
16+
libstdc++6:i386 \
17+
libcurl4-gnutls-dev \
18+
libcurl4-gnutls-dev:i386 && \
419
apt-get install --yes --install-recommends \
520
steamcmd && \

Dockerfile/WINEHQ

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,24 @@ dpkg --add-architecture i386 && \
33
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
44
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' && \
55
apt-get --quiet update && \
6+
# Wine 5.x+ requires libfaudio0, but not included on Ubuntu < 19.10.
7+
# https://forum.winehq.org/viewtopic.php?f=8&t=32192
8+
# https://askubuntu.com/questions/1100351/broken-packages-fix-problem-for-wine
9+
apt-get install --yes --install-recommends \
10+
libsdl2-2.0-0 \
11+
libsdl2-2.0-0:i386 \
12+
libc6 \
13+
libc6:i386 && \
14+
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 && \
15+
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 && \
16+
dpkg -i /tmp/libfaudio0_19.07-0~bionic_amd64.deb /tmp/libfaudio0_19.07-0~bionic_i386.deb && \
17+
618
apt-get --quiet --yes upgrade && \
719
apt-get install --yes --install-recommends \
820
lib32gcc1 \
921
winehq-stable \
1022
supervisor \
1123
xvfb && \
24+
25+
26+

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ D_DIR = Dockerfile
55
help:
66
@echo 'USAGE:'
77
@echo
8-
@echo 'make steam'
8+
@echo 'make stable'
99
@echo ' Build latest steam dedicated docker container.'
1010
@echo
11-
@echo 'make winehq'
12-
@echo ' Build latest steam dedicated docker with winehq repo container.'
11+
@echo 'make latest'
12+
@echo ' Build latest steam dedicated docker with latest winehq stable updates container.'
1313
@echo
1414
@echo 'make all'
1515
@echo ' Build all latest containers.'
1616

1717
.PHONY: help Makefile
1818

19-
all: steam winehq
19+
all: stable latest
2020

21-
steam: clean
21+
stable: clean
2222
@echo 'Building steam ubuntu container ...'
2323
@mkdir -p $(STAGING_DIR)
2424
@cp ${D_DIR}/BASE ${STAGING_DIR}/Dockerfile
@@ -35,13 +35,13 @@ steam: clean
3535
@cp -R source $(STAGING_DIR)
3636
@cd $(STAGING_DIR) && \
3737
docker build \
38-
-t rpufky/steam:latest \
38+
-t rpufky/steam:stable \
3939
.
4040
@echo
41-
@echo 'Remember to push to hub: docker push rpufky/steam:latest'
41+
@echo 'Remember to push to hub: docker push rpufky/steam:stable'
4242

43-
winehq: clean
44-
@echo 'Building steam ubuntu container using winehq repo ...'
43+
latest: clean
44+
@echo 'Building steam ubuntu container using wine stable latest from winehq repo ...'
4545
@mkdir -p $(STAGING_DIR)
4646
@cp ${D_DIR}/BASE ${STAGING_DIR}/Dockerfile
4747
@cat ${D_DIR}/LOCALE_BASE >> ${STAGING_DIR}/Dockerfile
@@ -57,10 +57,10 @@ winehq: clean
5757
@cp -R source $(STAGING_DIR)
5858
@cd $(STAGING_DIR) && \
5959
docker build \
60-
-t rpufky/steam:winehq \
60+
-t rpufky/steam:latest -t rpufky/steam:winehq \
6161
.
6262
@echo
63-
@echo 'Remember to push to hub: docker push rpufky/steam:winehq'
63+
@echo 'Remember to push to hub: docker push rpufky/steam:latest'
6464

6565

6666
clean:

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ After launching the container:
2424

2525
## Version Tags
2626

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

3232
## Parameters
3333

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

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

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

0 commit comments

Comments
 (0)