Sunday, June 22, 2008

VPS reboots and server stability

I've been fighting with the server mysteriously going down for some months.

Now I know why, and I'm silly to have not caught this before... my host occasionally reboots my machine. I usually think of linux machines as things that stay up for years, so it didn't occur to me right away.

Tomcat would come up and hog all the memory, and my server wasn't even in the list to start up.

So, I edited the reboot script:

vi /etc/rc.d/rc.local

(added)
rm -rf /travis/nohup.out-backup2
mv /travis/nohup.out-backup1 /travis/nohup.out-backup2
mv /travis/nohup.out /travis/nohup.out-backup1
cd /travis
nohup java -jar /travis/jags_server1.4m/dist/jags_server1.4m.jar &