From f96afdb62bc05dd4c2ec4ba53a9978218bd82746 Mon Sep 17 00:00:00 2001
From: David Walter Seikel
Date: Fri, 9 Dec 2016 07:16:10 +1000
Subject: Various little clean ups.

---
 InstallItAll.sh                                    | 36 +++++++-------
 .../Region/CoreModules/Asset/FlotsamAssetCache.cs  |  3 +-
 README.md                                          |  9 ++--
 config/OpenSimDefaults.ini                         | 14 +++---
 config/Robust.ini.template                         | 58 +++++++++++-----------
 config/config.ini                                  |  1 +
 config/sim01/My_sim.xml                            |  4 +-
 scripts/opensim-crontab.txt                        | 16 ------
 scripts/opensim.tmux.conf                          |  4 ++
 scripts/start-sim                                  |  2 +
 10 files changed, 71 insertions(+), 76 deletions(-)
 delete mode 100644 scripts/opensim-crontab.txt

diff --git a/InstallItAll.sh b/InstallItAll.sh
index ab1074d..124fd5a 100755
--- a/InstallItAll.sh
+++ b/InstallItAll.sh
@@ -1,12 +1,12 @@
 #!/bin/bash
 
-OSPATH="/opt/opensim_TEST"
+OSPATH="/opt/opensim"
 MYSQL_HOST="localhost"
 MYSQL_DB="InfiniteGrid"
 MYSQL_USER="opensim"
 OS_USER="opensim"
 
-OSVER="8.2.1"
+OSVER="0.8.2.1"
 
 
 # Figure out where we are, most of this mess is to troll through soft links.
@@ -51,21 +51,21 @@ fi
 USER=$(whoami)
 
 echo "Installing software."
-#sudo apt-get install mysql-server tmux mono-complete uuid-runtime monit mc
-#sudo /etc/init.d/mysql restart
+sudo apt-get install mysql-server tmux mono-complete nant nunit uuid-runtime monit mc
+sudo /etc/init.d/mysql restart
 
 echo "Setting up mySQL."
-#mysql -u root -p -h localhost << zzzzEOFzzz
-#create database if not exists '$MYSQL_DB';
-#create user '$OS_USER' identified by '$MYSQL_PASSWORD';
-#create user '$OS_USER'@'localhost' identified by '$MYSQL_PASSWORD';
-#grant all on $MYSQL_DB.* to '$OS_USER';
-#grant all on $MYSQL_DB.* to '$OS_USER'@'localhost';
-#FLUSH PRIVILEGES;
-#zzzzEOFzzz
+mysql -u root -p -h localhost << zzzzEOFzzz
+create database if not exists $MYSQL_DB;
+create user $OS_USER identified by '$MYSQL_PASSWORD';
+create user $OS_USER@localhost identified by '$MYSQL_PASSWORD';
+grant all on $MYSQL_DB.* to $OS_USER;
+grant all on $MYSQL_DB.* to $OS_USER@localhost;
+FLUSH PRIVILEGES;
+zzzzEOFzzz
 
 echo "Setting up OpenSim."
-sudo adduser --system --shell /bin/false --group $OS_USER
+sudo adduser --system --shell /bin/bash --group $OS_USER
 sudo addgroup $USER $OS_USER
 
 sudo rm -fr   $OSPATH/opensim-IG_*
@@ -85,9 +85,6 @@ sudo chmod -R g+w $OSPATH
 sudo chmod -R a+x $OSPATH/current/scripts/*.sh
 sudo chmod a+x $OSPATH/current/scripts/show-console
 sudo chmod a+x $OSPATH/current/scripts/start-sim
-sudo chmod ug+rwx  config
-sudo chmod g+s     config
-sudo chmod 600 config/config.ini
 
 for dir in AssetFiles backups caches config db logs
 do
@@ -96,11 +93,17 @@ do
     sudo ln -fs ../$dir $dir
 done
 
+sudo chmod ug+rwx  $OSPATH/config
+sudo chmod g+s     $OSPATH/config
+sudo chmod 600 $OSPATH/config/config.ini
+
 pushd config/ROBUST >/dev/null
+sudo ln -fs ../../current/scripts/common.sh common.sh
 sudo ln -fs ../../current/scripts/start-sim start-sim
 sudo ln -fs ../../current/scripts/start-sim stop-sim
 popd >/dev/null
 pushd config/sim01 >/dev/null
+sudo ln -fs ../../current/scripts/common.sh common.sh
 sudo ln -fs ../../current/scripts/start-sim backup-sim
 sudo ln -fs ../../current/scripts/start-sim start-sim
 sudo ln -fs ../../current/scripts/start-sim stop-sim
@@ -118,4 +121,3 @@ sudo chown $USER /home/$OS_USER/.tmux.conf
 sudo chmod 644 /home/$OS_USER/.tmux.conf
 
 sudo scripts/fix_var_run.sh
-sudo cat scripts/opensim-crontab.txt | sudo crontab -u $OS_USER -
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 98032cb..17646fb 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -599,7 +599,8 @@ namespace OpenSim.Region.CoreModules.Asset
             }
             catch (Exception e)
             {
-                m_log.Warn(string.Format("[FLOTSAM ASSET CACHE]: Could not complete clean of expired files in {0}", dir), e);
+//// TODO - I'm almost sure this is another case of failing to delete something that doesn't actually exist.
+////                m_log.Warn(string.Format("[FLOTSAM ASSET CACHE]: Could not complete clean of expired files in {0}", dir));
             }
         }
 
diff --git a/README.md b/README.md
index c648e6a..3ab2339 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
 Use this to create a sim that links into Infinite Grid from Linux.
 
-It's only been tested on Ubuntu 10.04, 11.04, and 12.04, YMMV.  This is
-also a WIP, use it at your own risk.  It's been used to set up two
-freshly installed Ubuntu servers though.
+It's only been tested on Ubuntu 10.04, 11.04, 12.04, and 16.04, YMMV. 
+This is also a WIP, use it at your own risk.  It's been used to set up
+a few freshly installed Ubuntu servers though.
 
 Follow these steps.
 -------------------
@@ -22,7 +22,7 @@ Next you need to figure out what password you want to use for OpenSims
 access to the database.  We will call this "DatabasePassword".  Run the
 following script -
 
-./install_opensim.sh DatabasePassword
+./InstallItAll.sh DatabasePassword
 
 This will do most of the work for you, except for creating sims.  There
 is a final step that needs to be done manually for now.  Edit
@@ -75,7 +75,6 @@ You can backup the sim with -
 
 ./backup-sim
 
-Though they all get backed up every six hours anyway.
 
 
 Finishing up.
diff --git a/config/OpenSimDefaults.ini b/config/OpenSimDefaults.ini
index b62bcd7..12ca68f 100644
--- a/config/OpenSimDefaults.ini
+++ b/config/OpenSimDefaults.ini
@@ -807,8 +807,8 @@
 
     ;# {OfflineMessageURL} {OfflineMessageModule:OfflineMessageModule Offline Message Module V2:Offline Message Module V2} {URL of offline messaging service} {}
     ;; URL of web service for offline message storage. Leave it commented if your service is local to the sim.
-    ; OfflineMessageURL = ${Const|BaseURL}/Offline.php
-    OfflineMessageURL = ${Const|BaseURL}:${Const|PrivatePort}
+    ; OfflineMessageURL = ${Const|GridURL}/Offline.php
+    OfflineMessageURL = ${Const|GridURL}:${Const|PrivatePort}
 
     ;# {StorageProvider} {Offline Message Module V2:Offline Message Module V2} {DLL that provides the storage interface} {OpenSim.Data.MySQL.dll}
     ;; For standalones, this is the storage dll.
@@ -822,7 +822,7 @@
     ;# {MuteListURL} {OfflineMessageModule:OfflineMessageModule} {} {} http://yourserver/Mute.php
     ;; URL of the web service that serves mute lists. Not currently used, but
     ;; must be set to allow offline messaging to work.
-    MuteListURL = "${Const|BaseURL}/opensim/mute.php"
+    MuteListURL = "${Const|GridURL}/opensim/mute.php"
 
     ;; Control whether group invites and notices are stored for offline users.
     ;; Default is true.
@@ -1960,9 +1960,9 @@
     ;; URI for the groups services of this grid
     ;; e.g. http://yourxmlrpcserver.com/xmlrpc.php for Flotsam XmlRpc
     ;; or http://mygridserver.com:82/Grid/ for SimianGrid
-    ;; or ${Const|BaseURL}:${Const|PrivatePort} for robust, V2
+    ;; or ${Const|GridURL}:${Const|PrivatePort} for robust, V2
     ;; Leave it commented for standalones, V2
-    GroupsServerURI = "${Const|BaseURL}:${Const|PrivatePort}"
+    GroupsServerURI = "${Const|GridURL}:${Const|PrivatePort}"
 
     ;# {HomeURI} {ServicesConnectorModule:Groups HG Service Connector} {What's the home address of this world?} {} 
     ;; Used for V2 in HG only. For example
@@ -2088,14 +2088,14 @@
     ;; points to your grid's Robust user profiles service
     ;;
     ; ProfileURL = http://127.0.0.1:9000
-    ProfileServiceURL = ${Const|BaseURL}:${Const|PublicPort}
+    ProfileServiceURL = ${Const|GridURL}:${Const|PublicPort}
 
 
 [XBakes]
     ;# {URL} {} {Set URL for Baked texture service} {}
     ;; Sets the URL for the baked texture ROBUST service.
     ;; Disabled when unset.
-    URL = ${Const|BaseURL}:${Const|PrivatePort}
+    URL = ${Const|GridURL}:${Const|PrivatePort}
 
 
 ;;
diff --git a/config/Robust.ini.template b/config/Robust.ini.template
index b7a68a6..4ee1bb3 100644
--- a/config/Robust.ini.template
+++ b/config/Robust.ini.template
@@ -153,14 +153,14 @@
     ;; runs the UserAgentsService, possibly this server.
     ;; For example http://myworld.com:8002
     ;; This is a default that can be overwritten in some sections.
-    HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
+    HomeURI = "${Const|GridURL}:${Const|PublicPort}"
 
     ;# {GatekeeperURI} {Hypergrid} {The URL of the gatekeeper of this world} {}
     ;; This is the address of the external robust server
     ;; that runs the Gatekeeper service, possibly this server.
     ;; For example http://myworld.com:8002
     ;; This is a default that can be overwritten in some sections.
-    GatekeeperURI = "${Const|BaseURL}:${Const|PublicPort}"
+    GatekeeperURI = "${Const|GridURL}:${Const|PublicPort}"
 
 [AccessControl]
     ;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
@@ -306,7 +306,7 @@
     ExportSupported = true
 
     ;; If you have this set under [Hypergrid], no need to set it here, leave it commented
-    ; GatekeeperURI = "${Const|BaseURL}:${Const|PublicPort}"
+    ; GatekeeperURI = "${Const|GridURL}:${Const|PublicPort}"
 
 
 ; * This is the configuration for the freeswitch server in grid mode
@@ -470,31 +470,31 @@
     AllowRemoteSetLoginLevel = "false"
 
     ; For V2 map
-    MapTileURL = "${Const|BaseURL}:${Const|PublicPort}/";
+    MapTileURL = "${Const|GridURL}:${Const|PublicPort}/";
 
     ; Url to search service
-    ; SearchURL = "${Const|BaseURL}:${Const|PublicPort}/";
+    ; SearchURL = "${Const|GridURL}:${Const|PublicPort}/";
 
     ; For V3 destination guide
-    ; DestinationGuide = "${Const|BaseURL}/guide"
+    ; DestinationGuide = "${Const|GridURL}/guide"
 
     ; For V3 avatar picker (( work in progress ))
-    ; AvatarPicker = "${Const|BaseURL}/avatars"
+    ; AvatarPicker = "${Const|GridURL}/avatars"
 
     ; If you run this login server behind a proxy, set this to true
     ; HasProxy = false
 
     ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs)
     ;; If you have GatekeeperURI set under [Hypergrid], no need to set it here, leave it commented
-    ; GatekeeperURI = "${Const|BaseURL}:${Const|PublicPort}"
+    ; GatekeeperURI = "${Const|GridURL}:${Const|PublicPort}"
 
-    SRV_HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_InventoryServerURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_AssetServerURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_ProfileServerURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_FriendsServerURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_IMServerURI = "${Const|BaseURL}:${Const|PublicPort}"
-    SRV_GroupsServerURI = "${Const|BaseURL}:${Const|PublicPort}"
+    SRV_HomeURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_InventoryServerURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_AssetServerURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_ProfileServerURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_FriendsServerURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_IMServerURI = "${Const|GridURL}:${Const|PublicPort}"
+    SRV_GroupsServerURI = "${Const|GridURL}:${Const|PublicPort}"
 
     ;# {DSTZone} {} {Override Daylight Saving Time rules} {* none local} "America/Los_Angeles;Pacific Standard Time"
     ;; Viewers do not receive timezone information from the server - almost all (?) default to Pacific Standard Time
@@ -551,42 +551,42 @@
     ; See http://opensimulator.org/wiki/GridInfo
 
     ; login uri: for grid this is the login server URI
-    login = ${Const|BaseURL}:${Const|PublicPort}/
+    login = ${Const|GridURL}:${Const|PublicPort}/
 
     ; long grid name: the long name of your grid
     gridname = "${Const|GridName}"
 
     ; short grid name: the short name of your grid
-    gridnick = "${Const|GridName}"
+    gridnick = "${Const|ShortGridName}"
 
     ; login page: optional: if it exists it will be used to tell the client to use
     ;                       this as splash page
-    ;welcome = ${Const|BaseURL}/welcome
+    welcome = ${Const|GridURL}/drupal/loginpage
 
     ; helper uri: optional: if it exists it will be used to tell the client to use
     ;                       this for all economy related things
-    ;economy = ${Const|BaseURL}/economy
+    ;economy = ${Const|GridURL}/economy
 
     ; web page of grid: optional: page providing further information about your grid
-    ;about = ${Const|BaseURL}/about
+    about = ${Const|GridURL}/drupal/
 
     ; account creation: optional: page providing further information about obtaining
     ;                             a user account on your grid
-    ;register = ${Const|BaseURL}/register
+    register = ${Const|GridURL}/drupal/content/How_to_join
 
     ; help: optional: page providing further assistance for users of your grid
-    ;help = ${Const|BaseURL}/help
+    help = ${Const|GridURL}/drupal/Tags/help
 
     ; password help: optional: page providing password assistance for users of your grid
-    ;password = ${Const|BaseURL}/password
+    password = ${Const|GridURL}/drupal
 
     ; HG address of the gatekeeper, if you have one
     ; this is the entry point for all the regions of the world
-    ; gatekeeper = ${Const|BaseURL}:${Const|PublicPort}/
+    ; gatekeeper = ${Const|GridURL}:${Const|PublicPort}/
 
     ; HG user domain, if you have one
     ; this is the entry point for all user-related HG services
-    ; uas = ${Const|BaseURL}:${Const|PublicPort}/
+    ; uas = ${Const|GridURL}:${Const|PublicPort}/
 
 
 [GatekeeperService]
@@ -601,7 +601,7 @@
     SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector"
     ; how does the outside world reach me? This acts as public key too.
     ;; If you have GatekeeperURI set under [Hypergrid], no need to set it here, leave it commented
-    ; ExternalName = "${Const|BaseURL}:${Const|PublicPort}"
+    ; ExternalName = "${Const|GridURL}:${Const|PublicPort}"
 
     ; Does this grid allow incoming links to any region in it? 
     ; If false, HG TPs happen only to the Default regions specified in [GridService] section
@@ -691,7 +691,7 @@
     AuthType = None
 
     ;; Can overwrite the default in [Hypergrid], but probably shouldn't
-    ; HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
+    ; HomeURI = "${Const|GridURL}:${Const|PublicPort}"
 
 
 ; * The interface that local users get when they are in other grids.
@@ -710,7 +710,7 @@
     AuthType = None
 
     ;; Can overwrite the default in [Hypergrid], but probably shouldn't
-    ; HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
+    ; HomeURI = "${Const|GridURL}:${Const|PublicPort}"
 
     ;; The asset types that this grid can export to / import from other grids.
     ;; Comma separated.
@@ -755,7 +755,7 @@
 
     ;; What is the HomeURI of users associated with this grid?
     ;; Can overwrite the default in [Hypergrid], but probably shouldn't
-    ; HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
+    ; HomeURI = "${Const|GridURL}:${Const|PublicPort}"
 
     ;; Sets the maximum number of groups an agent may join
     MaxAgentGroups = 420
diff --git a/config/config.ini b/config/config.ini
index 31ce07f..99d3c96 100644
--- a/config/config.ini
+++ b/config/config.ini
@@ -28,6 +28,7 @@
     ;# {BaseURL} {} {BaseURL} {"http://example.com" "http://127.0.0.1"} "http://127.0.0.1"
     HostName = "localhost"
     BaseURL = http://127.0.0.1
+    GridURL = http://grid.infinitegrid.org
 
     ;# {PublicPort} {} {PublicPort} {8002 9000} "8002"
     PublicPort = "8002"
diff --git a/config/sim01/My_sim.xml b/config/sim01/My_sim.xml
index 144cb0a..2f893ad 100644
--- a/config/sim01/My_sim.xml
+++ b/config/sim01/My_sim.xml
@@ -6,6 +6,8 @@
     <Key Name="InternalPort" Value="9106" />
     <Key Name="AllowAlternatePorts" Value="False" />
     <Key Name="ExternalHostName" Value="SYSTEMIP" />
-    <Key Name="RegionType" Value="public sim" />
+    <Key Name="RegionType" Value="private sim" />
+    <Key Name="SizeX" Value="256" />
+    <Key Name="SizeY" Value="256" />
   </Section>
 </Nini>
diff --git a/scripts/opensim-crontab.txt b/scripts/opensim-crontab.txt
deleted file mode 100644
index 2a0dbed..0000000
--- a/scripts/opensim-crontab.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-# to see current crontab for opensim
-#  $ sudo crontab -u opensim -l
-#
-# to install this crontab for opensim:
-#  $ cat /opt/opensim/current/scripts/opensim-crontab.txt | sudo crontab -u opensim -
-#
-# at midnight, remove old logs, files created 3 or more days ago
-#0 0 * * *       find /var/log/opensim -ctime +1 -delete
-# experimental version using savelog -c cycles all opensim log files over 7 days
-#0 0 * * *       /usr/bin/savelog -c 7 /var/log/opensim/*.log > /dev/null
-
-# Backup the inventories and sims every week.
-#0 */6 * * *       /opt/opensim/current/scripts/backup-sims.sh
-
-# Only backup inventories on the grid server itself.
-#55 */6 * * *       /opt/opensim/current/scripts/backup-inventories.sh
diff --git a/scripts/opensim.tmux.conf b/scripts/opensim.tmux.conf
index ecd0b04..c101f88 100644
--- a/scripts/opensim.tmux.conf
+++ b/scripts/opensim.tmux.conf
@@ -14,6 +14,7 @@ set-option -g bell-on-alert on
 
 set-option -g history-limit 100000
 
+# These three wont work under Ubuntu 16.04.
 set-option -g mouse-resize-pane on
 set-option -g mouse-select-pane on
 set-option -g mouse-select-window on
@@ -37,7 +38,10 @@ set-option -g visual-content on
 set-option -g visual-silence on
 
 set-option -gw clock-mode-style 24
+# This wont work under Ubuntu 16.04.
 set-option -gw mode-mouse on
+# Instead do this (also defaults to turning on the above three mouse things) -
+#set-option -gw mouse on
 
 # Highlight active window
 set-option -gw window-status-current-bg red
diff --git a/scripts/start-sim b/scripts/start-sim
index c9cca04..936fe13 100755
--- a/scripts/start-sim
+++ b/scripts/start-sim
@@ -102,6 +102,7 @@ case $(basename $0) in
 	;;
 
     "backup-inventory")
+	cd ${PRGDIR}
 	$SUDO ${PRGDIR}/gitAR.sh i "${inventory}"
 	user=$(sanitize "${inventory}")
 	# Add the full date and time to create the IAR file name.
@@ -112,6 +113,7 @@ case $(basename $0) in
 	;;
 
     "backup-sim")
+	cd ${PRGDIR}
 	$SUDO ${PRGDIR}/gitAR.sh o "${title}"
 	sim=$(sanitize "${title}")
 	# Add the full date and time to create the OAR file name.
-- 
cgit v1.1