OpenSimWorld is the directory of 3D Virtual Worlds based on OpenSimulator and connected through the HyperGrid. Learn More

Organization of the Simulator Folders (Version française en bas !)
Along with my PHP region management page ( https://i.gyazo.com/7173759f56b7dbe31f5c9a63022b2363.png https://i.gyazo.com/618efad4a65c887910cb10b0e6a6849d.png ), I've redesigned the entire organization of the simulator folders.
Instead of having a folder with all the bin files for each simulator launched with one or more region.ini files in their Regions folder, with the logs in bin/onpensim.log, I wanted to have a single bin folder and move the region-specific files (opensim.ini, snapshoot, region.ini, and opensim.log) into their own folder (a bit like DreamGrid does).
The advantage is that it saves a bit of space, but more importantly, to update OpenSim, you only have to update one folder. In addition, the assets_cache folder is shared across all regions. I think, from what I understand, that this could be an advantage; perhaps it prevents duplication...?
So, to move the logs (otherwise everything is mixed together in a single bin/opensim.log), everything is here: http://opensimulator.org/wiki/Logging
Basically, you modify bin/OpenSim.exe.config a little, and you just have to give the correct value to this LOGFILEPATH variable before launching OpenSim for a region. Then it's in the opensim.ini files, where you need to adapt the lines
*ConsoleHistoryFile="... (I didn't move this, so the command history remains common to all regions)
*PIDFile="... (I don't use it yet, but I probably will for some sort of monitoring)
*snapshot_cache_directory="
*but above all, regionload_regionsdir= where we'll put the regions.ini files

I also made a small modification by adding this because I switched regions to plain SQLite.
[DatabaseService]
StorageProvider = "OpenSim.Data.SQLite.dll"
ConnectionString = "URI=file:/home/osuser/osg/bin/Regions/${Const|RegionFolderName}/OpenSim.db,version=3"
commenting out ;Include-Storage = "config-include/storage/SQLiteStandalone.ini";
in bin/config-include/GridCommon.ini

And you can launch a region with something like this:
/usr/bin/screen -dmS OSG_Sandbox sh -c 'cd /home/osuser/osg/bin/; ulimit -u 15518; ulimit -s 131072; /usr/bin/dotnet OpenSim.dll -inifile=/home/osuser/osg/bin/Regions/Sandbox/OSG_Sandbox.ini'

By the way, since I launch my regions with my PHP page, I've separated the Apache launch so that restarting Apache doesn't stop all the regions running. I now use this:
sudo systemctl start opensim@OSG_Sandbox.service
Of course, the corresponding files are created by my PHP in /etc/systemd/system/ it also allows you to stop regions with a stop:
[Unit]
Description=OpenSim Instance OSG_Sandbox

[Service]
Type=forking
User=osuser
WorkingDirectory=/home/osuser/osg/bin/
Environment=LOGFILEPATH=/home/osuser/osg/bin/Regions/Sandbox/
LimitNPROC=15518
ExecStart=/usr/bin/screen -dmS OSG_Sandbox sh -c 'cd /home/osuser/osg/bin/; ulimit -u 15518; ulimit -s 131072; /usr/bin/dotnet OpenSim.dll -inifile=/home/osuser/osg/bin/Regions/Sandbox/OSG_Sandbox.ini'
ExecStop=/usr/bin/screen -S OSG_Sandbox -X stuff "q\n"
Restart=no
KillMode=none
TimeoutStopSec=300
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

Obviously, I received a lot of help from various AIs, but you have to get used to them... between the ones that quickly forget what you're talking about and the one that gives 20 pages for a single line of PHP, and all the rest... it takes patience. But I'm pretty proud of all that.

There you go, you should have all the information, as I've already done with some. I don't plan on spending months explaining things; I did it by searching on my own! But if I missed something or if there are any "shadows," you can always ask me...
*********************************************************************
En parallele à ma page php de gestion de mes régions ( https://i.gyazo.com/7173759f56b7dbe31f5c9a63022b2363.png https://i.gyazo.com/618efad4a65c887910cb10b0e6a6849d.png ) j'ai revu toute l'organisation des dossiers des simulateurs.
Au lieu d'avoir un dossier avec tous les fichiers bin pour chaque simulateur lancé avec une ou plusieurs régions.ini dans leur dossier Regions avec les log dans bin/onpensim.log, j'ai voulu avoir un seul dossier bin et déplacer les fichiers propres à chaque région (opensim.ini, snapshoot, region.ini et opensim.log) dans leur propre dossier ("un peu" comme le fait DreamGrid).
L'avantage est qu'on gagne un peu de place mais surtout que pour mettre à jour opensim on n'a plus qu'un seul dossier à mettre à jour. En plus le dossier assets_cache est commun a toutes les régions, je pense, d'après ce que j'ai compris, que ça peut etre un avantage, ça empeche peut etre des duplications ... ?
Donc, pour déplacer les logs (autrement tout est mélangé dans un seul bin/opensim.log) tout est là http://opensimulator.org/wiki/Logging
En gros on modifie un peu bin/OpenSim.exe.config et il faut seulement donner la bonne valeur à cette variable LOGFILEPATH avant de lancer opensim pour une région.
Ensuite ça se passe dans les fichiers opensim.ini ou il faut adapter les lignes
*ConsoleHistoryFile="... (moi je n'ai pas déplacé ça , l'historique des commandes reste donc comun a toutes les régions)
*PIDFile="... (je ne m'en sert pas encore mais je vais surement le faire pour une sorte de surveillance)
*snapshot_cache_directory="
*mais surtout regionload_regionsdir= ou on va mettre les regions.ini

J'ai aussi fait une petite modif en ajoutant ça car j'ai passé des régions en SQLite tout bete
[DatabaseService]
StorageProvider = "OpenSim.Data.SQLite.dll"
ConnectionString = "URI=file:/home/osuser/osg/bin/Regions/${Const|RegionFolderName}/OpenSim.db,version=3"
en commentant ;Include-Storage = "config-include/storage/SQLiteStandalone.ini";
dans bin/config-include/GridCommon.ini

et on peut lancer une région avec un truc de ce genre:
/usr/bin/screen -dmS OSG_Sandbox sh -c 'cd /home/osuser/osg/bin/; ulimit -u 15518; ulimit -s 131072; /usr/bin/dotnet OpenSim.dll -inifile=/home/osuser/osg/bin/Regions/Sandbox/OSG_Sandbox.ini'

D'ailleurs, comme je lance mes région avec ma page php j'ai dissocié le lancement de apache pour qu'un redémarrage de apache n'arrette pas toutes les régions qui tournent, je passe maintenant par ça
sudo systemctl start opensim@OSG_Sandbox.service
Bien sur les fichiers correspondant sont créés par mon php dans /etc/systemd/system/ il permettent aussi de stopper les regions avec un stop :
[Unit]
Description=OpenSim Instance OSG_Sandbox

[Service]
Type=forking
User=osuser
WorkingDirectory=/home/osuser/osg/bin/
Environment=LOGFILEPATH=/home/osuser/osg/bin/Regions/Sandbox/
LimitNPROC=15518
ExecStart=/usr/bin/screen -dmS OSG_Sandbox sh -c 'cd /home/osuser/osg/bin/; ulimit -u 15518; ulimit -s 131072; /usr/bin/dotnet OpenSim.dll -inifile=/home/osuser/osg/bin/Regions/Sandbox/OSG_Sandbox.ini'
ExecStop=/usr/bin/screen -S OSG_Sandbox -X stuff "q\n"
Restart=no
KillMode=none
TimeoutStopSec=300
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

Evidemment j'ai été beaucoup aidée par différentes IA mais il faut se les faire ... entre celles qui oublie vite de quoi on parle et celle qui donne 20 pages pour une seule ligne de php et tout le reste... il faut de la patience. Mais je suis assez fière de tout ça.

Voila, normalement vous avez toutes les infos, comme je l'ai déjà fait avec certaines, je ne prévois pas de passer des mois a expliquer, moi je l'ai fait en cherchant par moi même ! Mais si j'ai raté quelques chose ou si ya des "ombres" vous pouvez toujours me demander ...