[Resolvido]Monit não inicia processo java/jetty

Iniciado por bred81, 23 de Maio de 2014, 11:46

tópico anterior - próximo tópico

bred81

Estou tentando fazer o Monit reiniciar o solr4 mas ele não vai. Criei um script de start e de stop e estou monitorando a resposta dele por outro script.
Quando inicio na mão, ele fica OK, mas, quando desligo o solr pra ver se ele vai reiniciar...
Citar[BRT May 23 11:31:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:31:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:31:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:31:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:32:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:32:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:32:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:32:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:33:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:33:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:33:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:33:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:34:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:34:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:34:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:34:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:35:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:35:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:35:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:35:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:36:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:36:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:36:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:36:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:37:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:37:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:37:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:37:02] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:38:02] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:38:02] info     : 'myhttptest' trying to restart
[BRT May 23 11:38:02] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:38:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:39:03] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:39:03] info     : 'myhttptest' trying to restart
[BRT May 23 11:39:03] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:39:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:40:03] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:40:03] info     : 'myhttptest' trying to restart
[BRT May 23 11:40:03] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:40:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:41:03] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:41:03] info     : 'myhttptest' trying to restart
[BRT May 23 11:41:03] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:41:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:42:03] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:42:03] info     : 'myhttptest' trying to restart
[BRT May 23 11:42:03] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:42:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh
[BRT May 23 11:43:03] error    : 'myhttptest' '/home/bred/Programas/solr-4.8.1/example/response.sh' failed with exit status (0) -- no output from program
[BRT May 23 11:43:03] info     : 'myhttptest' trying to restart
[BRT May 23 11:43:03] info     : 'myhttptest' stop: /home/bred/Programas/solr-4.8.1/example/stop.sh
[BRT May 23 11:43:03] info     : 'myhttptest' start: /home/bred/Programas/solr-4.8.1/example/start.sh

As minhs configurações:
start.sh
#!/bin/bash

export JAVA_HOME=/usr/bin/java
pid_homei="/home/bred/Programas/solr-4.8.1/example"

$JAVA_HOME -jar ${pid_home}/start.jar &
exit 0


stop.sh
#!/bin/bash

pid_home="/home/bred/Programas/solr-4.8.1/example"
pid=$(ps aux | grep start.jar | grep -v "color" | tr -s '\t' ' ' | cut -d ' ' -f 1)

kill -9 $pid

exit 0


response.sh
#!/bin/bash

exit $(curl -sL -w "%{http_code}\\n" "http://localhost:8983/solr/collection1/admin/ping?wt=json" -o /dev/null)


meu arquivo de monitoração:
check program myhttptest with path /home/bred/Programas/solr-4.8.1/example/response.sh
start program = "/home/bred/Programas/solr-4.8.1/example/start.sh"
stop program = "/home/bred/Programas/solr-4.8.1/example/stop.sh"
    if status == 404 then restart
    if status == 000 then restart


Porque ele não está reiniciando?

################################################

O erro estava no momento de invoar o Jetty (que vem junto com o Solr).
Citar$ /usr/bin/java -jar /home/bred/Programas/solr-4.8.1/example/start.jar
java.io.FileNotFoundException: No XML configuration files specified in start.config or command line.
   at org.eclipse.jetty.start.Main.start(Main.java:502)
   at org.eclipse.jetty.start.Main.main(Main.java:96)

Usage: java -jar start.jar [options] [properties] [configs]
       java -jar start.jar --help  # for more information

Só dei um "cd" para a pasta antes de chamar o start.jar e funcionou.
O que o Mario foi fazer no pscicólogo?
- Ele estava passando por uma fase difícil...