Facepunch / garrysmod-issues

Garry's Mod issue tracker
137 stars 56 forks source link

Temporary lock file being created despite the multirun flag #4803

Open adamnejm opened 3 years ago

adamnejm commented 3 years ago

Environment

OS: EndeavourOS Linux 64bit Protocol Version: 24 EXE Version: 2020.10.14 EXE Build: 15:52:02 Jan 8 2021 (8098) GMod Version: 2021.01.22, branch: x86-64, multicore: 1

Details

Temporary .lock file is being created in the /tmp directory despite the -multirun parameter when running hl2.sh which prevents from launching multiple instances until deleted manually.

Reproducing

  1. Run sh hl2.sh -multirun -windowed -w 640 -h 480
  2. Repeat the command (attempt to run another instance)
  3. Following error will be displayed: fcntl(3) for /tmp/source_engine_2594845368.lock failed

Adding the -insecure had no effect.

Manual Fix

  1. Run the first instance (same as step 1. from the Reproducing section)
  2. Delete the created file (/tmp/source_engine_2594845368.lock)
  3. Launch the second instance
  4. If yet another instance is needed, repeat from step 2.
robotboy655 commented 3 years ago

Looks like the -multirun flag is not implemented on Linux/macOS by design in all Source Engine games, including TF2 and CS:GO.

Xalalau commented 2 months ago

Looks like the -multirun flag is not implemented on Linux/macOS by design in all Source Engine games, including TF2 and CS:GO.

We can at least run 2 copies of the game in Linux using a native Steam installation and a sandboxed one (Flatpak) on offline mode. It's good enough for testing stuff:

image

And here's some usefull commands that I crafted before discovering this issue:

# Get steam lib paths /home/$USER/.steam/bin32/steam-runtime/run.sh --print-steam-runtime-library-paths
# Fix SetLocale('en_US.UTF-8') failed https://github.com/ValveSoftware/halflife/issues/3006

GAMEROOT="/silo/Games/SteamLibrary/steamapps/common/GarrysMod"

cd "${GAMEROOT}"

SteamEnv=1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${GAMEROOT}"/bin:/home/$USER/.steam/bin32/steam-runtime/pinned_libs_32:/home/$USER/.steam/bin32/steam-runtime/pinned_libs_64:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib/i386-linux-gnu:/usr/local/lib:/lib/x86_64-linux-gnu:/lib32:/lib:/home/$USER/.steam/bin32/steam-runtime/lib/i386-linux-gnu:/home/$USER/.steam/bin32/steam-runtime/usr/lib/i386-linux-gnu:/home/$USER/.steam/bin32/steam-runtime/lib/x86_64-linux-gnu:/home/$USER/.steam/bin32/steam-runtime/usr/lib/x86_64-linux-gnu:/home/$USER/.steam/bin32/steam-runtime/lib:/home/$USER/.steam/bin32/steam-runtime/usr/lib ./hl2_linux -multirun

# Oh no! -multirun is unsupported... https://github.com/Facepunch/garrysmod-issues/issues/4803