monit-general
[Top][All Lists]
Advanced

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

Re: Where is Sylpheed-claws PID file?


From: Martin Pala
Subject: Re: Where is Sylpheed-claws PID file?
Date: Wed, 10 Jan 2007 11:28:39 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061222)

gabev wrote:


Martin Pala wrote:
Usually just daemons create a pidfile - user oriented programs such as email clients rarely.

Generally you can create the pidfile yourself for any program, see monit FAQ - question/answer no. 3 (http://www.tildeslash.com/monit/doc/faq.php).

Martin

gabev wrote:
Hi there,

I use monit on dsl linux and I'm having problems finding the PID file of
sylpheed-claws email client.I can see that it has a pid by using the ps
-aux
command but I cant find the sylpheed-claws.pid file itself.Any
suggestions?
Thankx

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


Hi Martin

I created a wrapper for Sylpheed-Claws named sylph and put it in
/usr/bin/.The contents of sylph are:

#!/bin/bash
export JAVA_HOME=/usr/bin/ CLASSPATH=sylpheed-claws:.

          case $1 in
           start)
           echo $$ > /var/run/sylpheed.pid;
           exec 2>&1 sylpheed-claws -cp ${CLASSPATH} org.something.with.main
\
1>/var/run/sylpheed.out ;; stop) kill `cat /var/run/sylpheed.pid` ;; *) echo "usage: sylpheed {start|stop}" ;;
          esac


Now from the terminal , logged in as root,  I can start sylpheed-claws by
issuing the command "sylph start" .If I start monit as daemon  ( monit -d 60
) sylpheed-claws is not started.In the monitrc file this is the entry for
sylpheed :

check process sylpheed-claws with pidfile /var/run/sylpheed.pid
   group mail
start program = "/usr/bin/sylph start"
   stop program = "/usr/bin/sylph stop"
   #if failed port 25 protocol smtp then restart
   #if 5 restarts within 5 cycles then timeout

I cannot start or stop the sylpheed-claws service through the web
interface.I get the Execution failed status.One little detail, I always run
sylpheed as root, maybe thats why  monit cannot start it?


The example in monit FAQ is just for imaginary java application. You need to customize the script for your application.

The JAVA_HOME, CLASSPATH and the "exec java -cp ${CLASSPATH} org.something.with.main" in the example are not monit related - it sets the environment for the application, the exec is specific command to invoke the given java application.

Monit starts the programs with the same uid as it is running (unless 'uid' or 'gid' options are used). Monit starts programs with restricted environment - this is most probably the reason why sylph is running when the script is started by hand and not running whstarted by monit => check the environment variables needed).

Martin









reply via email to

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