Jump to content

Linux Server Auto-restart.


noog

Recommended Posts

Posted

anyone know how i can get my (linux) mta server to automatically restart?

it's been dying on it's own every now and again and I could do with a way of keeping it up (excuse the pun) so i dont have to login and start it

Thanks :)

http://www.fr4g.co.uk - MTA servers from £15gbp!

fslbutton.png

Posted

This is the script I use to start mta, save logfiles and automatically restart when

it dies (or is killed):

#!/bin/sh
log=watchdog.log
dat=`date`
mtavc="/home/mta/mtavc/MTAServer0.4.1"

echo "${dat} watchdog script starting." >>${log}
while true
do
 if [ `ps -ax | grep -c '/home/mta/mtavc/MTAServer0.4.1'` -eq 0 ]
 then
   echo "${dat} Server exited, restarting..." >>${log}
   datstr=`date "+%Y-%m-%d-%H%M%S"`
   mv mtaserver.log ${datstr}.log
   ${mtavc} >/dev/null 2>&1 &
 fi
 sleep 30  
done

Posted

Thanks for that Nutz, I shall rename this topic slightly and move it to the Useful Topics section.

The artist formerly known as [MTA]MrBump

  • 1 year later...
Posted
anyone know how i can get my (linux) mta server to automatically restart?

it's been dying on it's own every now and again and I could do with a way of keeping it up (excuse the pun) so i dont have to login and start it

Thanks :)

script is needed. if y didn't managed to do it, ask

--

[email protected]

  • 4 weeks later...
Posted

I have a good script, add me on msn if you want me to send you it.

4m85g1y.png

Make sure to use the Search feature before posting a new topic.

Click here for detailed MTA: San Andreas server setup guides.

  • 7 months later...
Posted

Hey,

I know there is a couple downsides to "sleep", but it works fine for me. Using it with screen works perfectly, where you can just close the screen when your done with it. Take a look at "sleep" on good for more info :P

Cya,

Tommis

xe6za.gif

banner.gif

Best game server hosting. America East&West Coast, and many European locations available.

Click on the above link to check us out!

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...