monit-general
[Top][All Lists]
Advanced

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

Re: permision problem?


From: Martin Pala
Subject: Re: permision problem?
Date: Sat, 13 Jan 2007 00:09:50 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061219 Iceape/1.0.7 (Debian-1.0.7-1)

I don't know sylpheed, but in the case that it is X application, it will most probably need thee DISPLAY variable.

You should enable verbose mode when possible in the script on sylpheed startup and redirect the output and error output to some file.

Martin


gabev wrote:

    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

so finally with help I got the wrapper to create the pid file.I named the
wrapper sylph and put it in the /etc/init.d/ .The code  looks like that :

~~~~~~~~~~~~~~~~~~~
LOG_FILE=/tmp/CM_`date +%d%b%Y%H%M`.log
CM=`which sylpheed-claws`

if [ $? -ne 0 ]; then
  echo "Unable to find sylpheed-claws"
  exit 1
fi

case $1 in
start)
nohup $CM 1>$LOG_FILE 2>&1 &
echo $! > /tmp/sylpheed.pid
;;
stop) kill `cat /tmp/sylpheed.pid` ;; *) echo "usage: sylpheed {start|stop}" ;;
          esac
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I called monit from the terminal, as root, :

monit start sylpheed-claws

returns :

'sylpheed-claws' start : /etc/init.d/sylph
'sylpheed-claws' failed to start

"Monit starts programs with restricted
environment "....I modified monitrc entry to start and stop sylph as root

~~~~~~~~~~
check process sylpheed-claws with pidfile /tmp/sylpheed.pid
   group mail
start program = "/etc/init.d/sylph start"
     as uid dsl and gid staff
   stop program = "/etc/init.d/sylph stop"
      as uid root and gid root
   #if failed port 25 protocol smtp then restart
   #if 5 restarts within 5 cycles then timeout
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

still no go.Same error.

If i run the command from the root shell (/etc/init.d/sylph start) it works
perfect.What did I mixed wrong now?




reply via email to

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