PDA

View Full Version : Auto Reboot?


Esildor
06-05-2014, 02:04 AM
Hi friens,

I've been looking around and haven't found anything thus far. Am wondering if anyone has open-sourced any of their set ups for automated server reboots i.e. everyday at like 6 AM or something like that.

Thanks for your time!

Esildor

vsab
06-05-2014, 05:05 AM
Why do you need to do this? If there's a problem in the server that means you need to do it, we can add it as a bug to look into and fix.

I don't run a public server so my server only ever runs for 10 minutes or so at a time!

Esildor
06-05-2014, 05:12 AM
No idea what you mean.

There is no issue. I just know of servers out there(EZ comes to mind) that have an automated daily reboot. I personally have no idea how I would even go about setting that up. My post is simply asking if anyone has supplied something like this open source that I can look into.

Tabasco
06-05-2014, 07:07 AM
The technique can vary from setup to setup so I'm not surprised there isn't a one-size-fits-all solution out there.

crontab -e

00 4 * * * /usr/bin/php /opt/eqemu/server/doshutdown.php
10 4 * * * /opt/eqemu/server/stopall && /root/cacheclean.sh && /opt/eqemu/server/startall &


doshutdown.php

<?php

//Server broadcast
$baseurl = "http://username:password@[localhost|servername|ip]:9080/worldshutdown.html";

$dext = "?time=600&interval=60";

$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $baseurl.$dext);
curl_exec($ch);
curl_close($ch);
?>


worldshutdown.html - put in the templates folder for the server's http interface

<?

$stime = $request->get("time", "600");
$sinterval = $request->get("interval", "60");

$EQW->WorldShutDown($stime, $sinterval);

?>

rencro
06-06-2014, 10:20 AM
The AXClassic project has many of these. Here is a link to their linux scripts.

https://code.google.com/p/axclassic-repack/source/browse/#svn%2Ftrunk%2Flinux_scripts