Dr_Cox1911 Posted August 12, 2014 Posted August 12, 2014 I´m currently trying to enhance the performance of my server and therefore need some help. With build28 we can directly manage the server with console-commands, so it should be possible to do a grace restart. Some time ago I used a script which will simply kill the process and restart the sh-script, but I deactivated it because of potential damage to the map/save. I have decent linux skills but I´m kinda stuck here. What I would like to achieve with the restart-script:5min before restart send a message to all playerssend the "quit"-command to the serverwait a couple of minutesrestart the serverI´m stuck at the communication from my script to the actual game-server. Hope there are some Linux-cracks around here (looking at you Kirrus )
Connall Posted August 12, 2014 Posted August 12, 2014 I assume the script you talk about is mine perhaps and you're completely right. I don't know if direct server interaction through the console has been introduced yet, or if it's still on the horizon (I'm a bit out of date with some MP features right now) but if it's not, then I think this would be quite a difficult thing, short of some sort of script that has a dummy player admin on the server with which the server communicates with to execute the commands needed. (Think that's what minecraft, some arma servers do for example) However if there is RCON support, if the script was set up as a CRON job or something, then at the start of the script you broadcast a message, then run something like sleep in the script for 5 minutes, then execute the rest of the script then I suppose that would work as well. Probably not an answer you're looking for, but I thought I would shed some light on it all the same.
Viceroy Posted August 12, 2014 Posted August 12, 2014 I heard through the grapevine that in Build 28 admin commands can be entered into the server console. Haven't verified it though.
Deadend Posted August 12, 2014 Posted August 12, 2014 I heard through the grapevine that in Build 28 admin commands can be entered into the server console. Haven't verified it though. Yes, they can be.
Connall Posted August 12, 2014 Posted August 12, 2014 I heard through the grapevine that in Build 28 admin commands can be entered into the server console. Haven't verified it though. Yes, they can be. In which case it would be as simple as having the bash script run a command through screen (if that's how the server's set up.) Edit: If interested, I might mock something up.
Dr_Cox1911 Posted August 12, 2014 Author Posted August 12, 2014 Would be awesom if you (@Connall) could build something. I wanted to test some stuff today, but I got my new hardware and had to "play" with it instead
lan-online Posted November 13, 2014 Posted November 13, 2014 start serverscreen -S prz_zombi ./servers/projectzomboid/projectzomboid-dedi-server.sh cron* */3 * * * /root/zomboid_restart.sh zomboid_restart.sh #!/bin/bash screen -rd prz_zombiscreen -S prz_zombi -X stuff 'servermsg restart after 1 min\r'sleep 45sscreen -S prz_zombi -X stuff 'save\r'screen -S prz_zombi -X stuff 'Please disconnect for 30 sec\r'sleep 5s DATE=`date +%Y-%m-%d_%H-%M-%S`DIR=/root/backups/zomboidmkdir backupsmkdir $DIRcd $DIR # create backuptar -czf configs_$DATE.tar.gz -P /root/Zomboid /root/servers/projectzomboid/media/lua/shared/Sandbox # delete old backupfind $DIR -name "*.gz" -mtime 2 -exec rm -f {} \; screen -S prz_zombi -X stuff 'servermsg restart after 10 sec\r'sleep 5sscreen -S prz_zombi -X stuff 'servermsg 5 sec\r'sleep 1sscreen -S prz_zombi -X stuff 'servermsg 4 sec\r'sleep 1sscreen -S prz_zombi -X stuff 'servermsg 3 sec\r'sleep 1s screen -S prz_zombi -X stuff 'servermsg 2 sec\r'sleep 1sscreen -S prz_zombi -X stuff 'servermsg 1 sec\r'sleep 1sscreen -S prz_zombi -X stuff 'servermsg RESTART\r'sleep 1sscreen -X -S prz_zombi quitscreen -wipesleep 5s # restart/usr/bin/screen -dmS prz_zombi /root/servers/projectzomboid/projectzomboid-dedi-server.sh Use kaizokuroof and swak 2
ModdedTibby Posted February 5, 2015 Posted February 5, 2015 ARGHH ive been searching for something like this for ages but im running a windows dedicated server not linux....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now