[XAseco] XAseco crash rebooter

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

[XAseco] XAseco crash rebooter

Post by Kakkoii » 24 Mar 2009 12:05

These modified Aseco.sh & Aseco.bat files will start aseco.php back up if it crashes. Saving time when trying to code and test other plugin's on a server. Instead of having to restart aseco.php in SSH every time, you can just type /admin shutdown in game to reload aseco.php. It's generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)

Instructions:
* Replace your old "Aseco.sh" or "Aseco.bat" file with the one I have provided.
* Launch your server using the new "Aseco.sh" or "Aseco.bat" file.
* When in game, type /admin shutdown to restart aseco.php.

Aseco.sh

Code: Select all

#!/bin/bash
while true
do
#  php aseco.php TMN </dev/null >aseco.log 2>&1 &
  php aseco.php TMN
  rm aseco.txt

  rm nohup.out
  sleep 5
done

Aseco.bat

Code: Select all

@echo off

rem ****** Set here your php path *******

set INSTPHP=C:\Programme\Apache2\Php5

rem *************************************

PATH=%PATH%;%INSTPHP%;%INSTPHP%\extensions

REM change to directory this batch file was called from, to make sure it finds aseco.php
cd %~dp0

:restart
php.exe aseco.php
echo %errorlevel%

echo Program exit at %date% %time% - errorlevel %errorlevel% >> restart.txt

goto restart

REM if you want aseco to NOT restart itself automatically, add "pause" above the "goto restart" line
Last edited by Kakkoii on 06 Apr 2009 09:17, edited 17 times in total.
Come visit our server
Tet19 Music Tower

Amisxp
road tourist
road tourist
Posts: 81
Joined: 26 Dec 2008 10:28
Owned TM-games: TMUF
Location: Slovenia, Maribor

Re: [XAseco] XAseco Instant Restarter

Post by Amisxp » 24 Mar 2009 12:33

hey is this only for aseco or can i use also use it on xaseco O.o :roflol:

edit: im using xaseco v1.06 and when i try to restart my xaseco it says: [Aseco] You have to be MasterAdmin to restart Aseco (or something like this =x )

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] XAseco Instant Restarter

Post by Kakkoii » 24 Mar 2009 12:44

Amisxp wrote:hey is this only for aseco or can i use also use it on xaseco O.o :roflol:

edit: im using xaseco v1.06 and when i try to restart my xaseco it says: [Aseco] You have to be MasterAdmin to restart Aseco (or something like this =x )
It's for XAseco :). Do you have your login in the Master Admin list that's in your config.xml file?

edit: I updated the code. Xaseco 1.06 uses a slightly different admin arguement than 1.02. Should work for both versions now.
Come visit our server
Tet19 Music Tower

Amisxp
road tourist
road tourist
Posts: 81
Joined: 26 Dec 2008 10:28
Owned TM-games: TMUF
Location: Slovenia, Maribor

Re: [XAseco] XAseco Instant Restarter

Post by Amisxp » 24 Mar 2009 14:22

ok works now...but
is this plugin meant to crash xaseco and then reload it?
cuz my xaseco only crashes but it doesnt reload =/

ЭΛ Ğ尺乇ÇØ
sunday driver
sunday driver
Posts: 67
Joined: 22 Mar 2009 05:42
Owned TM-games: faadfad

Re: [XAseco] XAseco Instant Restarter

Post by ЭΛ Ğ尺乇ÇØ » 24 Mar 2009 16:22

Intresting plugin i will check it to my test server. :3

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] XAseco Instant Restarter

Post by Kakkoii » 24 Mar 2009 23:25

Amisxp wrote:ok works now...but
is this plugin meant to crash xaseco and then reload it?
cuz my xaseco only crashes but it doesnt reload =/
Sorry, I forgot that our server uses a custom Aseco.sh which checks to see if aseco.php is down at a set interval and starts it back up if it is. I have included the customized Aseco.sh in my post. :)
Come visit our server
Tet19 Music Tower

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] Instant XAseco Restarter

Post by Kakkoii » 04 Apr 2009 19:00

Anyone tested the windows .bat file? Need to know if it works.
Come visit our server
Tet19 Music Tower

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: [XAseco] Instant XAseco Restarter

Post by w1lla » 04 Apr 2009 19:10

tested on windows and works correct only forgot one thing to add.

Code: Select all

<?php
/**
* XAseco Restarter
* Restarts XAseco instantly.
* Created by Kakkoii of Tet19
*
* Dependencies: none
*
* Intructions:
* When in game, type /reaseco  to restart aseco.
**/

Aseco::addChatCommand('reaseco', 'restarts aseco');

function chat_reaseco($aseco, $command) {
   $admin = $command['author'];
   $login = $admin->login;
   $player = $aseco->server->players->getPlayer($login);
   $playernick = ($player->nickname);

if ($aseco->isMasterAdmin($login)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {
if ($aseco->isMasterAdmin($admin)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {   
   $message = '$000[$fffAseco$000]$FC0 Sorry '.$playernick.'$z$s$FC0, you need to be a MasterAdmin to restart Aseco!';            
   $aseco->addCall('ChatSendServerMessage', array($message));
}
}
}
?>

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] Instant XAseco Restarter

Post by Kakkoii » 04 Apr 2009 19:37

w1lla wrote:tested on windows and works correct only forgot one thing to add.

Code: Select all

<?php
/**
* XAseco Restarter
* Restarts XAseco instantly.
* Created by Kakkoii of Tet19
*
* Dependencies: none
*
* Intructions:
* When in game, type /reaseco  to restart aseco.
**/

Aseco::addChatCommand('reaseco', 'restarts aseco');

function chat_reaseco($aseco, $command) {
   $admin = $command['author'];
   $login = $admin->login;
   $player = $aseco->server->players->getPlayer($login);
   $playernick = ($player->nickname);

if ($aseco->isMasterAdmin($login)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {
if ($aseco->isMasterAdmin($admin)) {
   showReaseco($command['author'], $aseco->chat_commands, 'chat', false, false);
} else {   
   $message = '$000[$fffAseco$000]$FC0 Sorry '.$playernick.'$z$s$FC0, you need to be a MasterAdmin to restart Aseco!';            
   $aseco->addCall('ChatSendServerMessage', array($message));
}
}
}
?>
Thanks, and I didn't forget the "restarts aseco" part. It just isn't needed.
Come visit our server
Tet19 Music Tower

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: [XAseco] Instant XAseco Restarter

Post by w1lla » 04 Apr 2009 19:48

well it shows me this error

Code: Select all

[PHP Warning] Missing argument 2 for Aseco::addChatCommand(), called in D:\tmn\servertmnf\xaseco\plugins\restarter.php on line 13 and defined on line 1120 in file D:\tmn\servertmnf\xaseco\aseco.php
[XAseco] Try to connect to TM dedicated server on 127.0.0.1:5225

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] Instant XAseco Restarter

Post by Kakkoii » 04 Apr 2009 19:56

w1lla wrote:well it shows me this error

Code: Select all

[PHP Warning] Missing argument 2 for Aseco::addChatCommand(), called in D:\tmn\servertmnf\xaseco\plugins\restarter.php on line 13 and defined on line 1120 in file D:\tmn\servertmnf\xaseco\aseco.php
It still loads though :). But I guess I'll add that to the function just to put less junk in peoples log file.
Come visit our server
Tet19 Music Tower

Xymph
Pit Crew
Pit Crew
Posts: 5645
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [XAseco] Instant XAseco Restarter

Post by Xymph » 06 Apr 2009 08:18

Kakkoii wrote:I created this plugin as a quick way to reload XAseco from in game, saving time when trying to code and test other plugin's on the server, instead of having to kill aseco.php in SSH every time. It's also generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)
XAseco already has the /admin shutdown command built in, which handles the MasterAdmin test for you as well. You don't need a plugin for restarting, just the looping .sh/.bat files.

Also, your showReaseco function isn't defined in the plugin. Or maybe you're using that to force a PHP crash, but that's really ugly.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
Kakkoii
happy cruiser
happy cruiser
Posts: 142
Joined: 18 Dec 2007 06:32
Owned TM-games: TMU & TMO
Location: BC Canada, FTW!
Contact:

Re: [XAseco] Instant XAseco Restarter

Post by Kakkoii » 06 Apr 2009 09:07

Xymph wrote:
Kakkoii wrote:I created this plugin as a quick way to reload XAseco from in game, saving time when trying to code and test other plugin's on the server, instead of having to kill aseco.php in SSH every time. It's also generally just a nice option to have. Also allowing you to let people without SSH access to restart the server. (i.e: Other teammates)
XAseco already has the /admin shutdown command built in, which handles the MasterAdmin test for you as well. You don't need a plugin for restarting, just the looping .sh/.bat files.

Also, your showReaseco function isn't defined in the plugin. Or maybe you're using that to force a PHP crash, but that's really ugly.
Ah didn't know about that. Well it's still nice for people to have the looping scripts.
Come visit our server
Tet19 Music Tower

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [XAseco] XAseco crash rebooter

Post by Ant » 02 Feb 2010 19:37

I posted this in the XAseco v1.10 thread, but got no help - so I'm posting it here too as it seems a fitting place to do so.

I was just wondering, is it possible to force an automatic restart of XAseco on a Dedimania read timeout / connection failure ??

Its just I get this quite often:

Code: Select all

[XAseco] PHP Version is 5.3.1 on WINNT
[XAseco] Load settings [config.xml]
[XAseco] Load admin/ops lists [adminops.xml]
[XAseco] Load banned IPs list [bannedips.xml]
[XAseco] Load plugins list [plugins.xml]
[XAseco] Load plugin [plugin.localdatabase.php]
[XAseco] Load plugin [plugin.custom_chat.php]
[XAseco] Load plugin [plugin.rounds.php]
[XAseco] Load plugin [chat.admin.php]
[XAseco] Load plugin [chat.help.php]
[XAseco] Load plugin [chat.records.php]
[XAseco] Load plugin [chat.records2.php]
[XAseco] Load plugin [chat.recrels.php]
[XAseco] Load plugin [chat.dedimania.php]
[XAseco] Load plugin [chat.players.php]
[XAseco] Load plugin [chat.players2.php]
[XAseco] Load plugin [chat.wins.php]
[XAseco] Load plugin [chat.laston.php]
[XAseco] Load plugin [chat.stats.php]
[XAseco] Load plugin [chat.server.php]
[XAseco] Load plugin [chat.song.php]
[XAseco] Load plugin [chat.me.php]
[XAseco] Load plugin [plugin.tmxinfo.php]
[XAseco] Load plugin [plugin.sminfo.php]
[XAseco] Load plugin [plugin.track.php]
[XAseco] Load plugin [plugin.checkpoints.php]
[XAseco] Load plugin [plugin.dedimania.php]
[XAseco] Load plugin [plugin.rasp.php]
[XAseco] Load plugin [plugin.rasp_jukebox.php]
[XAseco] Load plugin [plugin.rasp_chat.php]
[XAseco] Load plugin [plugin.rasp_karma.php]
[XAseco] Load plugin [plugin.rasp_nextmap.php]
[XAseco] Load plugin [plugin.rasp_nextrank.php]
[XAseco] Load plugin [plugin.rasp_votes.php]
[XAseco] Load plugin [plugin.chatlog.php]
[XAseco] Load plugin [plugin.msglog.php]
[XAseco] Load plugin [plugin.style.php]
[XAseco] Load plugin [plugin.panels.php]
[XAseco] Load plugin [plugin.donate.php]
[XAseco] Load plugin [plugin.uptodate.php]
[XAseco] Load plugin [plugin.autotime.php]
[XAseco] Load plugin [jfreu.plugin.php]
[XAseco] Load plugin [mistral.idlekick.php]
[XAseco] Load plugin [plugin.matchsave.php]
[XAseco] Load plugin [plugin.fufi.widgets.php]
[XAseco] Load plugin [plugin.fufi.menu.php]
[XAseco] Load plugin [plugin.fufi.autoqueue.php]
[XAseco] Load plugin [vineeth.bet.plugin.php]
[XAseco] Load plugin [biggeordie.php]
[XAseco] Load plugin [plugin.xrestart.php]
[XAseco] Load plugin [plugin.google.php]
[XAseco] Load plugin [plugin.slap.php]
[XAseco] Load plugin [plugin.pbs.php]
[XAseco] Load plugin [plugin.elist.php]
[XAseco] Load plugin [plugin.private_message_window.php]
[XAseco] Load plugin [plugin.simplcp.php]
[XAseco] Load plugin [plugin.bestcps.php]
[XAseco] Load plugin [plugin.average.php]
[XAseco] Load plugin [plugin.finishes.php]
[XAseco] Load plugin [plugin.nouse.link.php]
[XAseco] Load plugin [plugin.nouse.button.php]
[XAseco] Load plugin [plugin.nouse.button1.php]
[XAseco] Load plugin [plugin.fave.servers.php]
[XAseco] Load plugin [plugin.teamspeak.php]
[XAseco] Load plugin [plugin.teamspeak.login.php]
[XAseco] Load plugin [plugin.topkarma.php]
[XAseco] Load plugin [plugin.whokarma.php]
[XAseco] Load plugin [plugin.forceMods.php]
[XAseco] Load plugin [plugin.milenco.v1.0.php]
[XAseco] Load plugin [plugin.lotto.php]
[XAseco] Try to connect to TM dedicated server on 127.0.0.1:5003
[XAseco] Try to authenticate with login 'SuperAdmin' and password 'EDIT'
[XAseco] Connection established successfully !
[Local DB] Load settings file [localdatabase.xml]
[Local DB] Try to connect to MySQL server on '127.0.0.1' with database 'xaseco'
[Local DB] MySQL Server Version is 5.1.41
[RASP] Cleaning up unused data
*-*-*-*-*-* RASP is running! *-*-*-*-*-*
|...Loading Settings
|...Loaded!
|...Checking database structure
|...Structure OK!
|...Calculating ranks
|...Done!
[RASP] Pruning records/rs_times for deleted tracks
[01/30,04:07:33] Load default style [styles/DarkBlur.xml]
[01/30,04:07:33] Load default admin panel [panels/AdminBelowChat.xml]
[01/30,04:07:33] Load default donate panel [panels/DonateBelowCPList.xml]
[01/30,04:07:33] Load default records panel [panels/RecordsRightBottom.xml]
[01/30,04:07:33] Load default vote panel [panels/VoteBelowChat.xml]
[01/30,04:07:33] ## ## ##  Lottery initialized! Ignored players: 0  ## ## ##
[01/30,04:07:33] ************* (Dedimania) *************
[01/30,04:07:33] * Dataserver connection on Dedimania ...
[01/30,04:07:33] * Try connection on http://dedimania.net:8018/Dedimania ...
[01/30,04:07:34] Webaccess (dedimania.net:80): send: deflate, receive: gzip
[01/30,04:07:34] * Connection and status ok! :)
[01/30,04:07:34] * NEWS (Dedimania, 08/05): news
[01/30,04:07:34] ------------- (Dedimania) -------------
[01/30,04:07:34] Load stats panel [panels/StatsUnited.xml]
###############################################################################
  XASECO v1.10 running on 127.0.0.1:5003
  Name   : XXX-Ant Forever - xxxantunited
  Game   : TmForever United - Stadium - TimeAttack
  Version: 2.11.23 / 2009-11-19
  Authors: Florian Schnell & Assembler Maniac
  Re-Authored: Xymph
###############################################################################
Begin Challenge
[01/30,04:07:34] forceMods: Stadium=>LoadScreen Island=>LoadScreen Speed=>LoadScreen Rally=>LoadScreen Bay=>LoadScreen Coast=>LoadScreen Alpine=>LoadScreen
[01/30,04:07:34] track changed [none] >> [ProDrift]
[01/30,04:07:34] current record on ProDrift is 1:09.79 and held by aledrobt
[01/30,04:08:45] Webaccess (dedimania.net:8018): Read timeout (20)
[01/30,04:08:45] Webaccess (dedimania.net:8018): send: deflate, receive: deflate
[01/30,04:12:21] Webaccess (dedimania.net:8018): Read timeout (20)
End Round
End Challenge
|...Calculating ranks
|...Done!
[01/30,04:12:23] set min timelimit for [Kinetic Energy]: 5:00 (Author time: 0:49.49)
Begin Challenge
[01/30,04:12:24] forceMods: Stadium=>LoadScreen Island=>LoadScreen Speed=>LoadScreen Rally=>LoadScreen Bay=>LoadScreen Coast=>LoadScreen Alpine=>LoadScreen
[01/30,04:12:24] track changed [ProDrift] >> [Kinetic Energy]
[01/30,04:12:24] current record on Kinetic Energy is 0:58.70 and held by XXX-Ant
[01/30,04:12:26] Webaccess (dedimania.net:8018): Error(10060) A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
, connection failed!
Begin Round
[01/30,04:13:14] Webaccess (dedimania.net:8018): Read timeout (20)
EDIT--> I use this crash rebooter already, but if this could be added too, then that would be very nice :thumbsup:

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: [XAseco] XAseco crash rebooter

Post by nocturne » 02 Feb 2010 23:49

Dedimania should attempt to reconnect in 30 minutes by default, and should send a chat message stating such. Seems like it's a bug in the webaccess include, not properly setting the isBad connection state when it times out...

Try increasing the $dedi_debug value in plugin.dedimania.php, and see what pops up in the log then.

As for an autorestart on dedimania timing out, perhaps use the $dedi_db global and run a function on the main loop event to restart if(!dedi_db).

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests