-
-
Notifications
You must be signed in to change notification settings - Fork 831
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
7 Days To Die stopping #345
Comments
I created my own fork to the code and submitted my code additions to the sdtdserver script and the fn_stop function file. I don't know if I need to create a pull request or not. |
Just seen the code looks good. I will test this myself and make any modifications. I have just created a development branch for LGSM. If you could do a pull request to the dev branch and I will make any changes then merge to master. Thanks for the code :D |
Looked at the code. It works well :-) . I will be however be adding some automation to ${telnetip} in that it wont require the user to set this in the sdtdserver script. The script will detect what to use automagicly (Will try localhost first if fails tries other options etc). The main issue currently is error handling isn't really setup. For example if you restart the server within 30 seconds of starting, telnet will not connect and gives connection refused. This would mean graceful shutdown failed but even if it did fail it would state it succeeded. This means failure is not logged in the scripts log. There are a few instances where telnet could refuse connection. It would also be useful for the script to be able to confirm the server shutdown did work e.g capturing telnet output and then picking up a word or phrase like "Disconnect". I have never used expect but I assume there is a way to capture the output from. ''' *** Connected with 7DTD server. Server IP: Any Press 'help' to get a list of all commands. Press 'exit' to end session. shutdown |
Good point. I was having some issues with it not connecting. What I had done originally was to create a separate file for just the expect script portion. Then I called the file form within the regular stop function. So in this: else I put the IF statement where the tmux kill-session line is. If the game is sdtd, it called the expect script for the telnet shutdown, if not, it still ran the tmux line. As far as Expect…. I didn’t know anything about it until 2-3 days ago when I looked up how to connect to telnet from a bash script. There probably is a way to capture the output or even use bash to capture the echo output since everything is being displayed to the screen. I suppose a check afterward to see if the tmux session still exists would work to see if it shutdown. Put in a pause for a few seconds to allow for the telnet to complete it’s shutdown and then check for the PID. Like I said, I just figure out the Expect code a couple days ago and last night rewrote it all to put it into the fn_stop file instead of having a separate file. But, the separate file seemed to work better I guess. I don’t know what to do about stopping right after starting again. My server did seem to respond pretty quick. Maybe a PID check to verify it’s running, then telnet. If telnet fails, wait 10 seconds and try again? I don’t know. |
I have made a few changes myself Keep uploading your changes to your repo and I can see what you are up to and I can comment and make my own changes :) If fails waiting x seconds would be a good idea. |
I have now implemented this feature |
aswesome explanation why I observed telnet errors (disabled in the server settings)
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Per conversation in the steam group forums, I'm creating an issue for 7 Days to Die shutdown procedures. The sdtdserver script uses the normal fn_stop function to "kill" any server processes. While this does indeed stop the server, it causes the day and time to be reset. At next server start, it will be Day 1 at 8am. The fix for this is a graceful shutdown using the "shutdown" command via either the built in telnet or web interface.
At present I have added some variables to the main sdtdserver script for telnet settings and then modified the fn_stop function file to check these variables and if the game is 7 Days To Die. If so, it will preform a telnet connection to the server and execute a shutdown command.
I'm not quite sure how to add this code here on git or create a fork.
I did rework my code today so that the fn_stop file should still be universal for all servers used.
The text was updated successfully, but these errors were encountered: