View Full Version : Quest to auto-restart server?
Sinclipse
06-03-2012, 01:38 AM
I've seen it on a few server, and me and my coder can't figure it out, anyone up for helping?
I want it set up to every 23 hours and 50 minutes a NPC will shout across zones that the server is coming down in 10 minutes. Then at 23 hours and 55 minutes that it'll be coming down in 5 minutes. Then start a countdown from 5 minutes to server shut down, then have the server brought up on it's own...
chrsschb
06-03-2012, 10:36 AM
Sorry I can't help you with the quest, but why do you need a 24hour restart cycle? That's crazy lol.
Durge
06-03-2012, 01:37 PM
So that he won't have to do random daily restarts for stuff unless it's very important, and that way it establishes a stable restart time where everyone knows when it will restart. Also keeps any changes very current.
Sinclipse
06-03-2012, 02:25 PM
^ This guy gets it.
iluvseq
06-04-2012, 01:21 PM
I suspect this sort of functionality is handled via an external script that runs at the proper time and connects to the telnet console to send the periodic broadcasts, issues a worldshutdown command, and then makes sure all processes are cleaned up before restarting the server.
chrsschb
06-04-2012, 06:54 PM
So that he won't have to do random daily restarts for stuff unless it's very important, and that way it establishes a stable restart time where everyone knows when it will restart. Also keeps any changes very current.
As a developer, I disagree. A 'stable' restart time is when needed. Generally once a week or so. If your server 'needs' restarts every day you have some underlying issues.
sorvani
06-05-2012, 12:40 AM
As a developer, I disagree. A 'stable' restart time is when needed. Generally once a week or so. If your server 'needs' restarts every day you have some underlying issues.
Not if you are tweaking things daily. Certain database changes do NOT go live without a reboot. Loot changes are a notable one.
Also if you choose to keep your server current to the SVN, it could easily get rebuilt daily at times when people are actively doing things to the server code like the last two days. Cavedude added a nice new feature for awarding LDoN win/losses to the Perl exports two days ago and then today Akkadius pushed a change for a global player.pl. Why should I have to wait a week to implement something? Setting up a scheduled daily reboot is simply respectful to your player base.
iluvseq
06-05-2012, 08:09 AM
It depends on the stage of development your server is currently at.
If your world building is complete and you are in maintenance mode where you are just making changes to fix bugs and tweak things, there's no reason to reboot daily.
If you are running an 'open beta' where your world is still constantly evolving, with new content (items, factions, etc) being added as you expand the world, then a daily reboot cycle makes sense.
Keeping up with SVN is not a good reason, however. By the very nature of eqemu, it is almost certain that your server is unique. You should test any new features/changes that get pushed to SVN on a non-production server for several days and then push to live after you are certain that they work as expected in your environment. Also, with a production server, you should only consider upgrading to a new code base if there is a bug fix or feature you actually need for your world.
Sinclipse
06-05-2012, 07:02 PM
It depends on the stage of development your server is currently at.
If your world building is complete and you are in maintenance mode where you are just making changes to fix bugs and tweak things, there's no reason to reboot daily.
If you are running an 'open beta' where your world is still constantly evolving, with new content (items, factions, etc) being added as you expand the world, then a daily reboot cycle makes sense.
Keeping up with SVN is not a good reason, however. By the very nature of eqemu, it is almost certain that your server is unique. You should test any new features/changes that get pushed to SVN on a non-production server for several days and then push to live after you are certain that they work as expected in your environment. Also, with a production server, you should only consider upgrading to a new code base if there is a bug fix or feature you actually need for your world.
We are currently in open beta. Which is why I'm seeking a once a day reset thing, EZ Server for instance, has one. The entire server shuts down and gets brought back up. Would be kinda nice to get it.
wolfwalkereci
06-06-2012, 03:14 PM
What OS are you using? Most of the servers with the automated reboots are using some flavor of Linux. If you are as well then check the appropriate section on the forum.
lerxst2112
06-06-2012, 04:45 PM
You could make a script to do this through telnet pretty easily in perl on Windows or Linux, but I don't remember seeing any example scripts floating around.
cavedude
06-06-2012, 07:43 PM
PEQ runs Linux, and its daily reboot/maintenance/backup is handled by cron and bash scripts. I use a bash script to telnet into the server and give players a warning of the shutdown. The script is simple, and requires the expect package:
#!/usr/bin/expect -f
spawn telnet 127.0.0.1 9000
expect "Username:"
send "yourname\n"
expect "Password:"
send "yourpassword\n"
expect "yourname>"
send "broadcast The server will be rebooting in 10 minutes. Please get to a safe location.\n"
expect "yourname>"
send "exit\n"
Just replace yourname and yourpassword with the appropriate values and if on a different server than local (which I don't recommend, unless you're using a VPN) change the IP as well.
Sinclipse
06-07-2012, 03:28 AM
Rocking a Window's 7.
lerxst2112
06-07-2012, 02:11 PM
This first example here shows you how to do the exact same thing in Perl. http://www.perlfect.com/articles/telnet.shtml
It should work on Windows as well as Linux.
wolfwalkereci
06-10-2012, 03:13 PM
PEQ runs Linux, and its daily reboot/maintenance/backup is handled by cron and bash scripts. I use a bash script to telnet into the server and give players a warning of the shutdown. The script is simple, and requires the expect package:
#!/usr/bin/expect -f
spawn telnet 127.0.0.1 9000
expect "Username:"
send "yourname\n"
expect "Password:"
send "yourpassword\n"
expect "yourname>"
send "broadcast The server will be rebooting in 10 minutes. Please get to a safe location.\n"
expect "yourname>"
send "exit\n"
Just replace yourname and yourpassword with the appropriate values and if on a different server than local (which I don't recommend, unless you're using a VPN) change the IP as well.
Thanks cavedude I knew you had one. Linux based OS is > me , one day I need to dive in and learn it.
Lerxst2112 thats a nice link. Should give me a few hours of entertainment tonight. Thanks for posting it.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.