Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Additional options for monitor to be able to run a script when it restarts server #4554

Open
dualarrow opened this issue Apr 7, 2024 · 3 comments

Comments

@dualarrow
Copy link

User story

As server admin I want to improve automation for monitoring

Game

Rust but this feature may assist other games too

Linux distro

Other

Command

command: monitor

Further information

Rust fas a plugin named SmoothRestarter that can stop the server to allow the controlling script to perform an update for rust or oxide. It alerts the players to let them get back to base etc. If I allow it to stop the server when an oxide update is available, it stops the server, then monitor restarts it, but as I cant have it run another script, oxide is not updated. This cycle continues forever. Currently I have had to disable this feature as LinuxGSM doesnt appear to have an option to execute a script when monitor detects a stopped server.

It would be very useful if an option was added to rustserver.cfg to be able to specify a script to be run just prior to the restart to allow any updates to be performed.

@MicLieg
Copy link
Contributor

MicLieg commented Apr 23, 2024

This feature exists, but it's not easy to configure.

LGSM has the ability to specify fixes that can be run before EVERY startup or right after installation. There is some documentation for this.

Rust in fact already takes advantage of these fixes: https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/modules/fix_rust.sh

@dualarrow
Copy link
Author

Thanks for the info. I just tried what the docs said and I initially got an error saying I had registered it but the file wasn't found. When I added the info to core_modules.sh the error went away but my script didnt seem to execute. I have a very simple script to test it. It just echos text to file. I did a chmod ugo+x to my script. If I run it manually with ./fix_rusticraiders.sh it does what I expect, but doing a './rustserver restart' doesnt seem to execute it.
If theres a forum for getting help with this could you let me know.
either way, feel free to close this ticket. It looks like it should do what I need if I can get it to run.
Thanks.

@MicLieg
Copy link
Contributor

MicLieg commented Apr 24, 2024

Fixes are always specific to a single game. The convention is fix_${shortname}.sh.

In your case, a fix for rust already exists so you simply have to append your fix to the fix_rust.sh file. Probably very similar to the Carbon mod fix.

There is a LinuxGSM Discord where you can ask for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New Issues
Development

No branches or pull requests

2 participants