LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[Bug]: failure during restart causes server to be stopped but not started back up

Open ddan39 opened this issue 2 years ago • 1 comments

User story

If it is not going to run the start after the stop, then it shouldn't stop it, or if it does run stop it should always try its hardest to then start it back up.

Game

Project Zomboid

Linux distro

Debian 12

Command

command: restart

Further information

I think what's happening, but i'm not positive, is that command_restart.sh has an exitbypass=1 before command_stop.sh, so if you run into something like a permissions check like I did, it doesn't stop the command_stop.sh from running, but in core_exit.sh the exitbypass is unset after it is bypassed once, so for command_start.sh the permission check prevents it from running since exitbypass is now unset. It almost seems like the exitbypass was meant to be set before command_start.sh instead of command_stop.sh so that the stop runs then it would at least try to start the server even if there was some error.

Relevant log output

$ ~/pzserver restart
[ FAIL ] Stopping pzserver: Permissions issues found
Information! The following files are not executable:
File
/home/pztestserver/lgsm/modules/.check_permissions.sh.swp
[  OK  ] Stopping pzserver: Graceful: sending "quit": 8: OK

Steps to reproduce

No response

ddan39 avatar Jul 28 '23 22:07 ddan39

So I have looked at the code and exitbypass is preventing the checks from exiting LinuxGSM. exitbypass allows start to run after stop in restart by not exiting. However the side effect looks like if there is a genuine issue the server will still stop. I will look at a way to allow checks to exit even with exitbypass enabled.

Thanks for the bug report

dgibbs64 avatar Sep 04 '23 21:09 dgibbs64

For this issue I have added restart to all teh checks that are run with START and STOP as well. This should mean that STOP will not run if a check fails.

dgibbs64 avatar Jun 21 '25 18:06 dgibbs64