monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Application fails to start.


From: Martin Pala
Subject: Re: Application fails to start.
Date: Fri, 25 Mar 2005 08:40:38 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041217

Hello,

can you try following steps?

1.) start your application manualy using your script

2.) provide 'ps -ef | grep A3Server'

3.) provide 'cat /var/run/cA3Server.pid' output

4.) start monit in debug mode ... using '-v' option


I'm not sure yet where the problem is, but i think it may be either:

- race condition between you startup script pidfile creation section and monit process start watching thread

- or inconsistency in pidfile and real process pid

Thanks,
Martin

jbelant wrote:
Hello,

I've just discovered monit, and have been experimenting with it. It looks like a great application, but I am having a problem starting my own applications.

I created a wrapper script, since my app doesn't set a PID file. The script looks like this.

#!/bin/sh
case $1 in
  start)
    cd /home/eminer/cA3Server
    ( /home/eminer/cA3Server/cA3Server > /dev/tty6 ) &
    pgrep cA3Server > /var/run/cA3Server.pid
  ;;
  stop)
    kill `cat /var/run/cA3Server.pid`
    rm /var/run/cA3Server.pid
  ;;
  *)
    echo "usage: rc.a3server {start|stop}" ;;
esac

I have tried this script with and without the '&' to detach the process, and monit can't control it either way. I can control the application from a console using this script, and it works. Using this script, monit can stop the application, but can't start it. A clip from my monit log looks like this.

[CST Mar 23 10:50:50] Starting monit daemon with http interface at [*:443]
[CST Mar 23 10:50:50] Starting monit HTTP server at [*:443]
[CST Mar 23 10:50:50] monit HTTP server started
[CST Mar 23 10:50:56] 'A3Server' stop: /home/eminer/bin/rc.a3server
[CST Mar 23 10:53:25] 'A3Server' stop: /home/eminer/bin/rc.a3server
[CST Mar 23 10:56:45] 'A3Server' stop: /home/eminer/bin/rc.a3server
[CST Mar 23 10:56:51] 'A3Server' start: /home/eminer/bin/rc.a3server
[CST Mar 23 10:56:52] monit: pidfile `/var/run/cA3Server.pid' does not contain a valid pidnumber [CST Mar 23 10:56:52] monit: pidfile `/var/run/cA3Server.pid' does not contain a valid pidnumber [CST Mar 23 10:56:53] monit: pidfile `/var/run/cA3Server.pid' does not contain a valid pidnumber

The PID file is recreated at start, but it is empty. Running the start script manually from a console correctly creates the PID file, with the proper PID.

Here is a clip of my monitrc file.

 check process ssh
    with pidfile "/var/run/sshd.pid"
    start program = "/etc/rc.d/rc.sshd start"
    stop program = "/etc/rc.d/rc.sshd stop"
    if 2 restarts within 3 cycles then timeout

 check process A3Server
    with pidfile "/var/run/cA3Server.pid"
    start program = "/home/eminer/bin/rc.a3server start"
    stop program = "/home/eminer/bin/rc.a3server stop"
    if 2 restarts within 3 cycles then timeout

I can use monit to control ssh perfectly. It may be a problem with my control script, but I haven't been able to find the problem. I have searched these archives, but haven't been able to figure this problem out.

Any help would be appreciated.

Thanks,

Jim Belant


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

[Prev in Thread] Current Thread [Next in Thread]