monit-general
[Top][All Lists]
Advanced

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

Issue with start/stop commands


From: Benjamin Krajmalnik
Subject: Issue with start/stop commands
Date: Tue, 22 May 2012 11:35:21 -0600

I have some shell scripts which I use to stop or start some daemons written in php.

They work fine when issued from the command line, but are not executing when issued from monit.

 

 

Stop script:

 

#!/bin/sh

#stop a php daemon

mydaemon="$1.php"

killstring="/bin/ps -aux | /usr/bin/grep 'php $mydaemon' | /usr/bin/awk ' {print \$2}' | /usr/bin/xargs /bin/kill -s KILL && sleep 10"

echo Stopping $mydaemon >> /var/log/restart.log

echo $killstring >> /var/log/restart.log

eval $killstring

And they are called from monit as follows:

 

‘/root/stopdaemon.sh daemonname’

 

When I look at /var/log/restart.log, the syntax is being parsed properly, so killstring is correct.  IF I run it from the console using the root account, it works fine.

 

Any ideas?  Running monit 5.2.5 under FreeBSD 8.1/amd64

 


reply via email to

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