-1

I have monit able to watch the program but the start script is not working. The stop script works just fine.

The when monit tries to start it, it just says execution failed.

Monit part

check process tsdnsserver
  matching "tsdnsserver"
  start program = "/bin/bash -c '/root/ts3/tsdns/stop.sh'"
  stop program = "/bin/bash -c '/root/ts3/tsdns/stop.sh'"
  if failed port 41144 type tcp then restart
  if 2 restarts within 3 cycles then timeout

Start Script

#!/bin/bash
screen -dmS tsdns ./tsdnsserver 41144

Stop Script

#!/bin/bash
screen -X -S tsdns kill
Ryahn
  • 113
  • 4
  • Does the start script work when you run it manually from the command line ? Does the 'start program' command run when you are in /tmp for example ? – user9517 May 27 '16 at 05:51
  • Is here any relevant information in your logs ? – user9517 May 27 '16 at 05:57
  • @lain This is the error I get when I try to use monit to start it. `[UTC May 27 06:04:25] error : M/Monit handler failed, retry scheduled for next cycle [UTC May 27 06:04:25] info : 'tsdnsserver' start: /root/ts3/tsdns/start.sh ` I am not sure what you mean to start it in /tmp I an run the script manually. – Ryahn May 27 '16 at 06:05
  • 1
    both the start and stop lines in the "monit part" show stop.sh... is this correct? – Peter May 27 '16 at 12:32
  • @peter That was my fault on my copying kunfu. I am not sure why monit can run the stop script just fine but the start one wont work at all. – Ryahn May 27 '16 at 16:05

1 Answers1

0

I am not sure what happened. I was able to change my start line to

start program = "/bin/bash -c 'screen -dmS tsdns /root/ts3/tsdns/tsdnsserver 41144'"

It now works for whatever reason

Ryahn
  • 113
  • 4