Reiniciando um programa com monit

1

Espero que alguém possa me ajudar com isso: Estou executando um servidor de jogo que falha com um segfault a cada 3 horas, estou tentando obter um script de reinicialização funcionando, mas sou um noob completo quando se trata de Linux (Debian) Diretório de trabalho é: / home / (nome de usuário) / workspace / MMOCoreORB / bin Para iniciar o programa: ./ core3 Começa no terminal e vai até o acidente de 3 horas ... No momento eu instalei monit mas não tenho idéia do que fazer a seguir .... Copiei a seção de reinicialização do Apache2 na configuração do monit e fiz alterações para executar o programa de que preciso, mas não sei se fiz o certo ...

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
    
por David 13.07.2013 / 19:47

0 respostas