diff options
author | David Walter Seikel | 2011-11-26 14:35:08 +1000 |
---|---|---|
committer | David Walter Seikel | 2011-11-26 14:35:08 +1000 |
commit | 4a1156f2802bda785e67a58893ba74517b672cc6 (patch) | |
tree | 7d1f2c68a286f06cbc66b973c2a81ef1ef3c8827 | |
parent | Fixing typos one letter at a time. Added a word to, making this one slightly... (diff) | |
download | IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.zip IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.gz IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.bz2 IGnoble-4a1156f2802bda785e67a58893ba74517b672cc6.tar.xz |
Added screen support, plus some tweaks.
-rwxr-xr-x | install_opensim.sh | 22 | ||||
-rw-r--r-- | opensim.screenrc | 20 | ||||
-rwxr-xr-x | start-sim-in-rest | 73 |
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; | |||
26 | zzzzEOFzzz | 26 | zzzzEOFzzz |
27 | 27 | ||
28 | echo "Setting up OpenSim" | 28 | echo "Setting up OpenSim" |
29 | sudo deluser opensim | 29 | sudo deluser opensim --remove-home |
30 | sudo adduser --system --shell /bin/false --group opensim | 30 | sudo adduser --system --shell /bin/false --group opensim |
31 | sudo cp opensim.screenrc /home/opensim/.screenrc | ||
32 | sudo chmod 744 /home/opensim/.screenrc | ||
31 | sudo mkdir -p /var/log/opensim | 33 | sudo mkdir -p /var/log/opensim |
32 | sudo chown opensim:opensim /var/log/opensim | 34 | sudo chown opensim:opensim /var/log/opensim |
33 | sudo chmod 777 /var/log/opensim | 35 | sudo chmod 777 /var/log/opensim |
@@ -38,7 +40,10 @@ sudo mkdir -p /opt/opensim | |||
38 | sudo chown $USER:$USER /opt/opensim | 40 | sudo chown $USER:$USER /opt/opensim |
39 | 41 | ||
40 | cd /opt/opensim | 42 | cd /opt/opensim |
41 | wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 | 43 | if [ ! -e opensim-0.7.1.1-infinitegrid-03.tar.bz2 ] |
44 | then | ||
45 | wget https://github.com/downloads/infinitegrid/InfiniteGrid-Opensim/opensim-0.7.1.1-infinitegrid-03.tar.bz2 | ||
46 | fi | ||
42 | tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 | 47 | tar xjf opensim-0.7.1.1-infinitegrid-03.tar.bz2 |
43 | ln -s opensim-0.7.1.1-infinitegrid-03 current | 48 | ln -s opensim-0.7.1.1-infinitegrid-03 current |
44 | mkdir -p config | 49 | mkdir -p config |
@@ -56,7 +61,6 @@ mv NSLModules.Messaging.MuteList.dll ../../modules/ | |||
56 | ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll | 61 | ln -s ../../modules/NSLModules.Messaging.MuteList.dll NSLModules.Messaging.MuteList.dll |
57 | mv OpenSimProfile.Modules.dll ../../modules/ | 62 | mv OpenSimProfile.Modules.dll ../../modules/ |
58 | ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll | 63 | ln -s ../../modules/OpenSimProfile.Modules.dll OpenSimProfile.Modules.dll |
59 | #sudo chown -R opensim:opensim ../../modules | ||
60 | ln -s ../../config config | 64 | ln -s ../../config config |
61 | 65 | ||
62 | cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz | 66 | cat > OpenSim.ConsoleClient.ini << zzzzEOFzzzz |
@@ -86,5 +90,17 @@ sed -i 's@; StorageProvider = "OpenSim.Data.MySQL.dll"@StorageProvider = "OpenSi | |||
86 | sed -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 | 90 | sed -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 | ||
88 | cd ../../.. | 92 | cd ../../.. |
93 | |||
94 | # Setting screen to be suid. EWWWWWW!!! Security hole!! | ||
95 | #ImReallyParanoid="true" | ||
96 | if [ "x$ImReallyParanoid" = "x" ] | ||
97 | then | ||
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 | ||
102 | fi | ||
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 | |||
3 | termcapinfo xterm* ti@:te@ | ||
4 | startup_message off | ||
5 | vbell off | ||
6 | autodetach on | ||
7 | altscreen on | ||
8 | shelltitle "$ |bash" | ||
9 | defscrollback 10000 | ||
10 | defutf8 on | ||
11 | nonblock on | ||
12 | |||
13 | hardstatus alwayslastline | ||
14 | hardstatus 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 | |||
16 | bind 'q' quit | ||
17 | |||
18 | multiuser on | ||
19 | acladd 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 | ||
3 | osversion="current" | 3 | # Pick one of these depending on how you want your access. |
4 | NeedARest=" -console=rest" | 4 | # NOTE - REST does not work. B-( |
5 | #NeedARest=" -console=rest" | ||
5 | NeedARest="" | 6 | NeedARest="" |
7 | Screaming="true" | ||
8 | #Screaming="" | ||
9 | |||
10 | USER=$(whoami) | ||
11 | |||
12 | console_name=screen_console | ||
13 | if [ "$USER" = "opensim" ] | ||
14 | then | ||
15 | screen_session=opensim/${console_name} | ||
16 | screen_check="screen -ls opensim/" | ||
17 | else | ||
18 | screen_session=${console_name} | ||
19 | screen_check="screen -ls" | ||
20 | fi | ||
21 | osversion="current" | ||
6 | 22 | ||
7 | if [ x$1 = x ]; then | 23 | if [ "x$1" = "x" ]; then |
8 | pathname=$(pwd) | 24 | pathname=$(pwd) |
9 | tgt=$(basename $pathname) | 25 | tgt=$(basename $pathname) |
10 | elif [ -d ./$1 ]; then | 26 | elif [ -d "./$1" ]; then |
11 | tgt=$1 | 27 | tgt=$1 |
12 | elif [ -d ./sim$1 ]; then | 28 | elif [ -d "./sim$1" ]; then |
13 | tgt=sim$1 | 29 | tgt=sim$1 |
14 | fi | 30 | fi |
15 | 31 | ||
16 | if [ x$tgt = x ]; then | 32 | if [ "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 |
21 | fi | 37 | fi |
22 | 38 | ||
23 | inidir=/opt/opensim/config/${tgt} | 39 | if [ "x$Screaming" = "xtrue" ] |
24 | bindir=/opt/opensim/${osversion}/bin | 40 | then |
25 | if [ 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 | ||
48 | fi | ||
49 | |||
50 | if [ "x$tgt" = "xrobust" ]; then | ||
26 | exe="Robust" | 51 | exe="Robust" |
27 | else | 52 | else |
28 | exe="OpenSim" | 53 | exe="OpenSim" |
29 | fi | 54 | fi |
55 | inidir=/opt/opensim/config/${tgt} | ||
56 | bindir=/opt/opensim/${osversion}/bin | ||
57 | cmd="/usr/bin/mono ${exe}.exe -inidirectory=${inidir} -logconfig=${inidir}/${exe}.exe.config $NeedARest" | ||
30 | 58 | ||
59 | # Check if it's already running. | ||
31 | if [ ! -e /var/run/opensim/${tgt} ] | 60 | if [ ! -e /var/run/opensim/${tgt} ] |
32 | then | 61 | then |
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 | ||
35 | fi | 77 | fi |
36 | 78 | ||
37 | if [ "x$NeedARest" = x } | 79 | # Either way, need to start up the console after. |
80 | if [ "x$Screaming" = "xtrue" ] | ||
81 | then | ||
82 | echo "Starting screen client." | ||
83 | screen -r ${screen_session} -A | ||
84 | elif [ "x$NeedARest" != "x" ] | ||
38 | then | 85 | then |
39 | echo "Starting rest client." | 86 | echo "Starting rest client." |
40 | cd ${inidir} | 87 | cd ${inidir} |