From 8655cc7f909876d793f7a71be3b6b4ac589fc91c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 9 Dec 2016 15:25:42 +1000 Subject: Move the example sim to a sim skeleton, suitable for scripting. --- config/sim01/My_sim.xml | 13 ------------- config/sim01/ThisSim.ini | 6 ------ config/sim01/opensim-monit.conf | 29 ----------------------------- config/sim_skeleton/My_sim.xml | 13 +++++++++++++ config/sim_skeleton/ThisSim.ini | 10 ++++++++++ config/sim_skeleton/opensim-monit.conf | 29 +++++++++++++++++++++++++++++ 6 files changed, 52 insertions(+), 48 deletions(-) delete mode 100644 config/sim01/My_sim.xml delete mode 100644 config/sim01/ThisSim.ini delete mode 100644 config/sim01/opensim-monit.conf create mode 100644 config/sim_skeleton/My_sim.xml create mode 100644 config/sim_skeleton/ThisSim.ini create mode 100644 config/sim_skeleton/opensim-monit.conf (limited to 'config') diff --git a/config/sim01/My_sim.xml b/config/sim01/My_sim.xml deleted file mode 100644 index 2f893ad..0000000 --- a/config/sim01/My_sim.xml +++ /dev/null @@ -1,13 +0,0 @@ - -
- - - - - - - - - -
-
diff --git a/config/sim01/ThisSim.ini b/config/sim01/ThisSim.ini deleted file mode 100644 index e7953ab..0000000 --- a/config/sim01/ThisSim.ini +++ /dev/null @@ -1,6 +0,0 @@ -[Startup] - PIDFile = "/var/run/opensim/sim01.pid" - regionload_regionsdir="/opt/opensim/config/sim01" - -[Network] - http_listener_port = 9105 diff --git a/config/sim01/opensim-monit.conf b/config/sim01/opensim-monit.conf deleted file mode 100644 index 9d66ce6..0000000 --- a/config/sim01/opensim-monit.conf +++ /dev/null @@ -1,29 +0,0 @@ -# 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. -# -# 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 = "/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 MEMORY usage > 25% 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 - depends on ROBUST diff --git a/config/sim_skeleton/My_sim.xml b/config/sim_skeleton/My_sim.xml new file mode 100644 index 0000000..c5723f3 --- /dev/null +++ b/config/sim_skeleton/My_sim.xml @@ -0,0 +1,13 @@ + +
+ + + + + + + + + +
+
diff --git a/config/sim_skeleton/ThisSim.ini b/config/sim_skeleton/ThisSim.ini new file mode 100644 index 0000000..2f691f0 --- /dev/null +++ b/config/sim_skeleton/ThisSim.ini @@ -0,0 +1,10 @@ +[Const] + mysim="SIM_NUMBER" + +[Startup] + PIDFile = "/var/run/opensim/sim${Const|mysim}.pid" + regionload_regionsdir="/opt/opensim/config/sim${Const|mysim}" + LogFile = "../logs/OpenSim_sim${Const|mysim}.log" + +[Network] + http_listener_port = SIM_PORT diff --git a/config/sim_skeleton/opensim-monit.conf b/config/sim_skeleton/opensim-monit.conf new file mode 100644 index 0000000..ac50fc2 --- /dev/null +++ b/config/sim_skeleton/opensim-monit.conf @@ -0,0 +1,29 @@ +# 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. +# +# 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 simSIM_NUMBER with pidfile /var/run/opensim/simSIM_NUMBER.pid + start program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/simSIM_NUMBER && /opt/opensim/config/simSIM_NUMBER/start-sim -q'" + as uid root and gid root + stop program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/simSIM_NUMBER && /opt/opensim/config/simSIM_NUMBER/stop-sim'" with timeout 600 seconds + if cpu usage > 50% for 4 cycles then restart + if MEMORY usage > 25% 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 + depends on ROBUST -- cgit v1.1