From b0837d553bef3029090d137725315bd55566e62e Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 8 Feb 2012 15:04:12 +1000 Subject: Hmmmm, seems that monit changing to a user and running bash -l is different from sudo changing to a user and running bash -l. --- opensim-monit.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opensim-monit.conf b/opensim-monit.conf index 9688a25..7785056 100644 --- a/opensim-monit.conf +++ b/opensim-monit.conf @@ -19,10 +19,12 @@ # # see ../README for configuration instructions. # +# Hmmmm, seems that monit changing to a user and running bash -l is different from sudo changing to a user and running bash -l. +# check process sim01 with pidfile /var/run/opensim/sim01.pid - start program = "/bin/bash -c 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/start-sim -q'" - as uid opensim and gid opensim - stop program = "/bin/bash -c 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/stop-sim'" with timeout 600 seconds + start program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/start-sim -q'" + as uid root and gid root + stop program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/stop-sim'" with timeout 600 seconds if cpu usage > 50% for 4 cycles then restart # if 5 restarts within 5 cycles then timeout # if failed url http://127.0.0.1:9005/jsonSimStats/ -- cgit v1.1