arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
684 stars 144 forks source link

Stop server from starting if update in progress #566

Closed Log1x closed 6 years ago

Log1x commented 8 years ago

Hi.

I currently run 4 instances of arkmanager on my dedicated box and have had a great experience so far!

One thing I found to be problematic though is when doing arkmanager start @all with auto-update on start enabled along with a cronjob to automatically check for updates, if you do it during an update the start script will tell you that an update is already in progress and then start the server anyway while it's being updated.

This can lead to issues and potential corruption. Anyway to store the steamcmd.sh update pid in a file or something per-instance and then make the server not start if its currently being updated (or start after it's finished)?

My cronjob's are as followed:

*/15 * * * * /usr/local/bin/arkmanager update @pve --warn --saveworld --update-mods --backup >/dev/null 2>&1
*/15 * * * * /usr/local/bin/arkmanager update @pvp --warn --saveworld --update-mods --backup >/dev/null 2>&1
*/15 * * * * /usr/local/bin/arkmanager update @valhalla --warn --saveworld --update-mods --backup >/dev/null 2>&1  
*/15 * * * * /usr/local/bin/arkmanager update @test --warn --saveworld --update-mods --backup >/dev/null 2>&1

along with:

arkAutoUpdateOnStart="true"

Here's an example of this happening (and ending in a server that is not joinable due to mod corruption and client side compatibility issues):

steam@dev:~/servers/arkonia_server$ arkmanager start @pve
Running command 'start' for instance 'pve'
[  ERROR  ]     Mod 576432474 is requested but not installed.  Run 'arkmanager installmod 576432474' to install this mod.
Updating server
Update already in progress (PID: 34621)
The server is starting...
The server is now running, and should be up within 10 minutes

Fortunately with how awesome the arkmanager backup scripts are (and also having them as a cronjob) this didn't result in any major issues, but I still feel a fix should definitely be looked into to prevent this from happening whether it be a cronjob or human error (accidentally starting twice while having 2 terminals open, etc.)

Thank you!

klightspeed commented 8 years ago

I have pushed a fix for this (653006a) to master.

Log1x commented 8 years ago

Can we get this fix in 1.6-dev as well?

Thanks

klightspeed commented 8 years ago

It is now in 1.6-dev and 1.6-dev.unstable