From 3c279d6c3b66a7f5ad49e16180b69ffa94513dc5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 8 Nov 2016 22:17:09 +1000 Subject: Installation script. --- config/ROBUST/opensim-monit.conf | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 config/ROBUST/opensim-monit.conf (limited to 'config/ROBUST') diff --git a/config/ROBUST/opensim-monit.conf b/config/ROBUST/opensim-monit.conf new file mode 100644 index 0000000..70190b9 --- /dev/null +++ b/config/ROBUST/opensim-monit.conf @@ -0,0 +1,36 @@ +# manage the OpenSim process for Your Sim +# +# usage: +# monit start your_sim +# monit stop your_sim +# monit restart your_sim +# +# see 'daemon' setting in /etc/monit/monitrc for the cycle length. +# on ubuntu/debian, this is overridden by the CHECK_INTERVALS var in +# /etc/default/monit . the below assumes you've set it to 30 seconds. +# +# if process dies, will restart sim within 30 seconds. if process +# dies 5 times in as many tries, will stop trying and send email +# alert. +# +# if SimFPS drops to 0 for 2 minutes, restart. +# +# if process CPU usage stays above 300% for 2 minutes, restart. +# +# 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 ROBUST with pidfile /var/run/opensim/ROBUST.pid + start program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/ROBUST && /opt/opensim/config/ROBUST/start-sim -q'" + as uid root and gid root + stop program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/ROBUST && /opt/opensim/config/ROBUST/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/ +# and content != '"SimFPS":0.0,' for 4 cycles +# then restart +# if failed url http://127.0.0.1:9008/jsonSimStats/ +# and content == '"SimFPS":' for 4 cycles +# then restart + -- cgit v1.1