aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2011-11-26 14:35:08 +1000
committerDavid Walter Seikel2011-11-26 14:35:08 +1000
commit4a1156f2802bda785e67a58893ba74517b672cc6 (patch)
tree7d1f2c68a286f06cbc66b973c2a81ef1ef3c8827
parentFixing typos one letter at a time. Added a word to, making this one slightly... (diff)
downloadIGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.zip
IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.gz
IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.bz2
IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.xz
Added screen support, plus some tweaks.
-rwxr-xr-xinstall_opensim.sh22
-rw-r--r--opensim.screenrc20
-rwxr-xr-xstart-sim-in-rest73
3 files changed, 99 insertions, 16 deletions
diff --git a/install_opensim.sh b/install_opensim.sh
index 0c8c659..14d7c42 100755
--- a/install_opensim.sh
+++ b/install_opensim.sh
@@ -26,8 +26,10 @@ FLUSH PRIVILEGES;
26zzzzEOFzzz 26zzzzEOFzzz
27 27
28echo "Setting up OpenSim" 28echo "Setting up OpenSim"
29sudo deluser opensim 29sudo deluser opensim --remove-home
30sudo adduser --system --shell /bin/false --group opensim 30sudo adduser --system --shell /bin/false --group opensim
31sudo cp opensim.screenrc /home/opensim/.screenrc
32sudo chmod 744 /home/opensim/.screenrc
31sudo mkdir -p /var/log/opensim 33sudo mkdir -p /var/log/opensim
32sudo chown opensim:opensim /var/log/opensim 34sudo chown opensim:opensim /var/log/opensim
33sudo chmod 777 /var/log/opensim 35sudo chmod 777 /var/log/opensim
@@ -38,7 +40,10 @@ sudo mkdir -p /opt/opensim
38sudo chown $USER:$USER /opt/opensim 40sudo chown $USER:$USER /opt/opensim
39 41
40cd /opt/opensim 42cd /opt/opensim
41wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 43if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ]
44then
45 wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2
46fi
42tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 47tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2
43ln -s opensim-0.7.1.1-infinitegrid-03 current 48ln -s opensim-0.7.1.1-infinitegrid-03 current
44mkdir -p config 49mkdir -p config
@@ -56,7 +61,6 @@ mv NSLModules.Messaging.MuteList.dll ../../modules/
56ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll 61ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll
57mv OpenSimProfile.Modules.dll ../../modules/ 62mv OpenSimProfile.Modules.dll ../../modules/
58ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll 63ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll
59#sudo chown -R opensim:opensim ../../modules
60ln -s ../../config config 64ln -s ../../config config
61 65
62cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz 66cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz
@@ -86,5 +90,17 @@ sed -i 's@; StorageProvider = "OpenSim.Data.MySQL.dll"@StorageProvider = "OpenSi
86sed -i "s@; ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=\*\*\*\*;\"@ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=$MYSQL_PASSWORD;\"@" GridCommon.ini 90sed -i "s@; ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=\*\*\*\*;\"@ConnectionString = \"Data Source=localhost;Database=opensim;User ID=opensim;Password=$MYSQL_PASSWORD;\"@" GridCommon.ini
87 91
88cd ../../.. 92cd ../../..
93
94# Setting screen to be suid. EWWWWWW!!! Security hole!!
95#ImReallyParanoid="true"
96if [ "x$ImReallyParanoid" = "x" ]
97then
98 sudo chmod u+s /usr/bin/screen
99 sudo chmod g+s /usr/bin/screen
100 sudo chmod 755 /var/run/screen
101 sudo chown root:utmp /var/run/screen
102fi
103
89#sudo chown -R opensim:opensim opensim-0.7.1.1-infinitegrid-03 104#sudo chown -R opensim:opensim opensim-0.7.1.1-infinitegrid-03
105#sudo chown -R opensim:opensim modules
90 106
diff --git a/opensim.screenrc b/opensim.screenrc
new file mode 100644
index 0000000..01a4f26
--- /dev/null
+++ b/opensim.screenrc
@@ -0,0 +1,20 @@
1# C-a :source .screenrc
2
3termcapinfo xterm* ti@:te@
4startup_message off
5vbell off
6autodetach on
7altscreen on
8shelltitle "$ |bash"
9defscrollback 10000
10defutf8 on
11nonblock on
12
13hardstatus alwayslastline
14hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][%= %{= kw}%?%-Lw%?%{= kW}%n*%f %t%?%?%{= kw}%?%+Lw%?%?%= ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'
15
16bind 'q' quit
17
18multiuser on
19acladd root
20
diff --git a/start-sim-in-rest b/start-sim-in-rest
index d6aac2c..4738c2e 100755
--- a/start-sim-in-rest
+++ b/start-sim-in-rest
@@ -1,40 +1,87 @@
1#!/bin/bash 1#!/bin/bash
2 2
3osversion="current" 3# Pick one of these depending on how you want your access.
4NeedARest=" -console=rest" 4# NOTE - REST does not work. B-(
5#NeedARest=" -console=rest"
5NeedARest="" 6NeedARest=""
7Screaming="true"
8#Screaming=""
9
10USER=$(whoami)
11
12console_name=screen_console
13if [ "$USER" = "opensim" ]
14then
15 screen_session=opensim/${console_name}
16 screen_check="screen -ls opensim/"
17else
18 screen_session=${console_name}
19 screen_check="screen -ls"
20fi
21osversion="current"
6 22
7if [ x$1 = x ]; then 23if [ "x$1" = "x" ]; then
8 pathname=$(pwd) 24 pathname=$(pwd)
9 tgt=$(basename $pathname) 25 tgt=$(basename $pathname)
10elif [ -d ./$1 ]; then 26elif [ -d "./$1" ]; then
11 tgt=$1 27 tgt=$1
12elif [ -d ./sim$1 ]; then 28elif [ -d "./sim$1" ]; then
13 tgt=sim$1 29 tgt=sim$1
14fi 30fi
15 31
16if [ x$tgt = x ]; then 32if [ "x$tgt" = "x" ]; then
17 echo "usage:" 33 echo "usage:"
18 echo " $ start-sim-in-rest <sim>" 34 echo " $ start-sim-in-rest <sim>"
19 echo "where <sim> is one of: " robust sim[0-9][0-9] 35 echo "where <sim> is one of: " robust sim[0-9][0-9]
20 exit 1 36 exit 1
21fi 37fi
22 38
23inidir=/opt/opensim/config/${tgt} 39if [ "x$Screaming" = "xtrue" ]
24bindir=/opt/opensim/${osversion}/bin 40then
25if [ x$tgt = xrobust ]; then 41 if ($screen_check | grep -q ${console_name}); then
42 echo "INFO: Screen already running"
43 true
44 else
45 echo "DEBUG: Starting screen"
46 screen -d -m -S ${console_name}
47 fi
48fi
49
50if [ "x$tgt" = "xrobust" ]; then
26 exe="Robust" 51 exe="Robust"
27else 52else
28 exe="OpenSim" 53 exe="OpenSim"
29fi 54fi
55inidir=/opt/opensim/config/${tgt}
56bindir=/opt/opensim/${osversion}/bin
57cmd="/usr/bin/mono ${exe}.exe -inidirectory=${inidir} -logconfig=${inidir}/${exe}.exe.config $NeedARest"
30 58
59# Check if it's already running.
31if [ ! -e /var/run/opensim/${tgt} ] 60if [ ! -e /var/run/opensim/${tgt} ]
32then 61then
33 cd ${bindir} 62 if [ "x$Screaming" = "xtrue" ]
34 /usr/bin/mono ${exe}.exe -inidirectory=${inidir} -logconfig=${inidir}/${exe}.exe.config $NeedARest 63 then
64 tmpfile=`mktemp`
65 echo "chdir ${bindir}" > ${tmpfile}
66 echo "screen -t ${tgt} ${cmd}" >> ${tmpfile}
67 chmod a+r ${tmpfile}
68 rm -f ${inidir}/start.screen
69 cp ${tmpfile} ${inidir}/start.screen
70 rm ${tmpfile}
71 # echo "INFO: start process and connect to screen (opensim)"
72 screen -r ${screen_session} -p "-" -X source ${inidir}/start.screen
73 else
74 cd ${bindir}
75 $cmd
76 fi
35fi 77fi
36 78
37if [ "x$NeedARest" = x } 79# Either way, need to start up the console after.
80if [ "x$Screaming" = "xtrue" ]
81then
82 echo "Starting screen client."
83 screen -r ${screen_session} -A
84elif [ "x$NeedARest" != "x" ]
38then 85then
39 echo "Starting rest client." 86 echo "Starting rest client."
40 cd ${inidir} 87 cd ${inidir}