CM2Walki / CSGO

Dockerfile for automated build of a CS:GO gameserver: https://hub.docker.com/r/cm2network/csgo/
https://CM2.Network
MIT License
249 stars 74 forks source link

sourcemod & metamod are not recognized on mounted volume #68

Closed michihupf closed 2 years ago

michihupf commented 2 years ago

I have been trying to use this image for developing some plugins. The problem I am facing though is that the server is up and running but not running metamod and sourcemod. The Dockerfile I used was this one.

Neither meta version nor sm version commands are working via RCON (although sm version is probably bot working because metamod is not working). I have my server directory on my host machine an I mount it into the image with the right arguments: docker run --net=host -v $(pwd)/server:/home/steam/csgo-dedicated/ --name=csgo-ds -e SRCDS_RCONPW="testing" -e SRCDS_LAN="1" -e SRCDS_PORT=27016 -e SRCDS_IP="0.0.0.0" -e SRCDS_PW="" csgods

CM2Walki commented 2 years ago

Post the output of docker logs csgo-ds please

michihupf commented 2 years ago

https://pastebin.com/GLrMe2pv

If everything had went as planned there should've been another output from my plugin: --> blah plugin loaded

CM2Walki commented 2 years ago

Yeah, looks like the image didn't download metamod or sourcemod. Did the bind mount location have any files in it before the first launch of your container?

Metamod and sourcemod only gets downloaded if the entry.sh can't find a server.cfg. I should probably split that up. https://github.com/CM2Walki/CSGO/blob/master/etc/entry.sh#L10

michihupf commented 2 years ago

This is weird I had rebuilt the image without having changed the contents of the server folder. I imply that I thought it would already have been downloaded previously.

So I have to just delete the server.cfg?

michihupf commented 2 years ago

Did the bind mount location have any files in it before the first launch of your container?

Yes, it had the entire server structure already in it. As I mentioned I only rebuilt the image (tbh I don't know anymore why I did).

CM2Walki commented 2 years ago

So I have to just delete the server.cfg?

You can, however back it up before you do it of course. Then restart the container, that should cause metamod and sourcemod to get downloaded. After that you can replace the server.cfg with your previous one.

EDIT: It could be that you ran a non-sourcemod csgo server before this. That's a use-case I didn't think about, I'll change the entry.sh to take that into account.

michihupf commented 2 years ago

Oh god now I get permission errors. I think that one is on me though as I chown'ed the server folder to modify files. Could this cause the other issues as well?

EDIT: It could be that you ran a non-sourcemod csgo server before this. That's a use-case I didn't think about, I'll change the entry.sh to take that into account.

I am pretty sure I ran the sourcemod image. I was looking for a docker image to do my plugin development.

michihupf commented 2 years ago

Quick update: After deleting the server.cfg I now get the message from my plugin on load. This means metamod and sourcemod are working now. Thank you.

I think I have a clue on why it wouldn't work before. As I chown'ed the server directory recursively the .vdf files also got owned by me (I did chmod a=rwx -R server/ also). Now that I also saw that if a server update gets downloaded the files are owned by 100999 again. Content of server/csgo/addons/ drwxrwxrwx - michi 3 Mär 15:41  metamod drwxrwxrwx - michi 3 Mär 15:41  sourcemod .rw------- 50 100999 27 Mai 2014  metamod.vdf .rw------- 58 100999 20 Dez 2017  metamod_x64.vdf

Is there a better way to manage file permissions to be able to edit (and also execute e.g. spcomp) files?

CM2Walki commented 2 years ago

Related to https://github.com/CM2Walki/TF2/issues/16