projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added 'squished on' phrase to file names.
[feisty_meow.git]
/
scripts
/
opensim
/
opensim_utils.sh
diff --git
a/scripts/opensim/opensim_utils.sh
b/scripts/opensim/opensim_utils.sh
index 3e84b705c58b6e0a5a3c4891c756023b840f0f8e..c45ab0de0113d63c789de05d0483a677516d6188 100644
(file)
--- a/
scripts/opensim/opensim_utils.sh
+++ b/
scripts/opensim/opensim_utils.sh
@@
-2,8
+2,10
@@
# this is a collection of scripts that assist in managing an opensim server.
# it uses the "screen" utility to manage opensimulator instances.
# this is a collection of scripts that assist in managing an opensim server.
# it uses the "screen" utility to manage opensimulator instances.
+source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+
# set up some parameters that we believe (or have been told) are beneficial.
# set up some parameters that we believe (or have been told) are beneficial.
-export MONO_THREADS_PER_CPU=
4
08
+export MONO_THREADS_PER_CPU=
12
08
# we run the processes with a little cpu de-prioritization. we do not want
# them taking over completely if there's a runaway mono tornado.
# we run the processes with a little cpu de-prioritization. we do not want
# them taking over completely if there's a runaway mono tornado.
@@
-15,11
+17,11
@@
export LANG=C
# this is used as a process startup snooze, to avoid running a dependent
# process before the dependency has really started.
# this is used as a process startup snooze, to avoid running a dependent
# process before the dependency has really started.
-export SNOOZE_TIME=
7
+export SNOOZE_TIME=
6
# lock the limit in for threads, so we don't have any getting out of control.
# also make sure we've provided enough space for each thread.
# lock the limit in for threads, so we don't have any getting out of control.
# also make sure we've provided enough space for each thread.
-ulimit -s
26
2144
+ulimit -s
51
2144
# use more recent versions of mono for opensim if they're available.
if [ -d /opt/mono-2.10/bin ]; then
# use more recent versions of mono for opensim if they're available.
if [ -d /opt/mono-2.10/bin ]; then
@@
-33,11
+35,16
@@
function launch_screen()
{
screen_name="$1"; shift
app_name="$1"; shift
{
screen_name="$1"; shift
app_name="$1"; shift
- echo "$(
mdate
): starting $screen_name now..."
+ echo "$(
date_stringer ' '
): starting $screen_name now..."
screen -L -S "$screen_name" -d -m nice -n $NICENESS_LEVEL mono "$app_name"
screen -L -S "$screen_name" -d -m nice -n $NICENESS_LEVEL mono "$app_name"
-#-console=basic
- echo "$(mdate): $screen_name started."
- sleep $SNOOZE_TIME
+##why? --debug
+#no, makes it ugly: -console=basic
+
+ echo "$(date_stringer ' '): $screen_name started."
+ # only sleep if we are not at the last process that gets started.
+ if [ "$app_name" != "OpenSim.exe" ]; then
+ sleep $SNOOZE_TIME
+ fi
}
# finds the opensim process specified or returns a blank string in the
}
# finds the opensim process specified or returns a blank string in the
@@
-59,13
+66,13
@@
function close_application()
{
screen_name="$1"; shift
process_name="$1"; shift
{
screen_name="$1"; shift
process_name="$1"; shift
- echo "$(
mdate
): stopping $screen_name now..."
+ echo "$(
date_stringer ' '
): stopping $screen_name now..."
screen -r -s "$screen_name" -X quit
# we don't want to shut any other servers down until this process is really gone.
find_opensim_process $process_name
if [ ! -z "$OS_PROC_ID" ]; then
screen -r -s "$screen_name" -X quit
# we don't want to shut any other servers down until this process is really gone.
find_opensim_process $process_name
if [ ! -z "$OS_PROC_ID" ]; then
- echo "$(
mdate
): waiting for $screen_name to really shut down..."
+ echo "$(
date_stringer ' '
): waiting for $screen_name to really shut down..."
sleep $SNOOZE_TIME
# check again after the snooze.
find_opensim_process $process_name
sleep $SNOOZE_TIME
# check again after the snooze.
find_opensim_process $process_name
@@
-73,7
+80,7
@@
function close_application()
find_opensim_process $process_name
#break out on timed basis.
done
find_opensim_process $process_name
#break out on timed basis.
done
- echo "$(
mdate
): $screen_name really is shut down now."
+ echo "$(
date_stringer ' '
): $screen_name really is shut down now."
#do this as last ditch, above in timeout
find_opensim_process $process_name
#do this as last ditch, above in timeout
find_opensim_process $process_name
@@
-85,6
+92,6
@@
function close_application()
fi
fi
- echo "$(
mdate
): $screen_name stopped."
+ echo "$(
date_stringer ' '
): $screen_name stopped."
}
}