This is most probably caused by missing environment variable. Monit
sets spartan environment/sandbox when starting services.
Here is FAQ item regarding short description from FAQ
(http://www.tildeslash.com/monit/doc/faq.php):
--8<--
6. Q: I'm having trouble getting monit to execute any "start" or
"stop" program commands. The log file says that they're being
executed, and I can't find anything wrong when I run monit in
verbose mode.
A: Monit did start the program but for some reason the service dies
later. Before we go on and introduce you to the fine art of
system debugging, it's worth to note that:
For security reasons monit purges the environment and only set a
spartan PATH variable that contains /bin, /usr/bin, /sbin and
/usr/sbin. If your program or script dies, the reason could be
that it expects certain environment variables or to find certain
programs via the PATH. If this is the case you should set the
environment variables you need directly in the start or stop
script called by monit.
--8<--
It's possible that your scripts need some environment variable which
is missing ... simply add everything what is needed to your scripts.
Martin
Stephen Adams wrote:
Hi,
I'm trying to get an application called JIRA to be monitored by monit.
I've created a /etc/init.d/jira script and also created a
/etc/monit.d/jira file which I've shown below
check process jira with pidfile /var/run/jira/jira.pid
group tomcat
start program "/etc/init.d/jira-start"
#start program "/etc/init.d/jira start"
stop program "/etc/init.d/jira-stop"
#stop program "/etc/init.d/jira stop"
if failed host 127.0.0.1 port 8085 protocol http
and request "/jira/"
then restart
if 5 restarts within 5 cycles then timeout
The problem I have is I can't get monit to successfully restart JIRA
if I use the command "/etc/init.d/jira start"
but if I write a script called /etc/init.d/jira-start
#!/bin/bash
/etc/init.d/jira start
and use that inside monit it works?!?
It's almost as if monit is truncating my start program directive when
it hits the first space.
Does anyone have any ideas here?
Cheers
Steve
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general