Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hopefully someone can help me out with this: I am running a game server that crashes with a segfault every 3 hours, I am trying to get a restart script working but I'm a complete noob when it comes to Linux(Debian) Working directory is: /home/(username)/workspace/MMOCoreORB/bin To start Program: ./core3 It starts in terminal and runs until the 3 hour crash... At the moment I've installed monit but I have no clue what to do next.... I copied the Apache2 restart section in the monit config and made changes to run the program I need but not sure I did it right either...

server.sh:

#!/bin/bash
 case $1 in
    start)
       echo $$ > server.pid;
    cd /home/user/workspace/MMOCoreORB/bin/
       exec ./core3
       ;;
     stop) 
       kill $(cat server.pid);
       rm server.pid
       ;;
     *) 
       echo "usage: server {start|stop}" ;;
 esac
 exit 0

monit config:

  GNU nano 2.2.4           File: /etc/monit/monitrc                             
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file and a complete list of statements and
## options, please have a look in the Monit manual.
##
##
###############################################################################
## Global section
###############################################################################
##
## Start Monit in the background (run as a daemon):
#
         set daemon  120           # check services at 2-minute intervals
share|improve this question
1  
Please show your Monit configuration. –  ewwhite Jul 13 '13 at 17:54
    
I edited my main post to show everything I have (see above) –  David Jul 13 '13 at 18:25
    
Have you looked at all the examples here? mmonit.com/wiki/Monit/ConfigurationExamples –  Zoredache Jul 13 '13 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.