Managing your linked region

1 post / 0 new
Once you have your region linked to Infinite Grid then will you need to perform a few management tasks to keep it working!

Useful Tools

Never forget:

If it doesn't work you get an immediate refund of your purchase price!

If you break it you get to keep both pieces!

 

Configuring Regions

If you are making more than one or two regions then an automated region generator will save a lot of time.

http://www.builtbuy.me/regionini is a simple web page which will generate both the ini file and the port set-ups that you will need. The website also takes care of generating a GOOD UUID for each region.

 

Modify OAR Files

On occasion you will want to modify your OAR files before you upload them. https://zonjacapalini.wordpress.com/2009/12/16/zoe-version-0-1-released/ is a free tool which allows "smart" editing of an OAR, and can do things like raise (or lower) the contents of an area, move selected contents within the region, and rotate the contents. https://zonjacapalini.wordpress.com/2009/12/14/moving-and-rotating-oars/

 

Midnight Commander

Midnight Commander is a command line based tool similar to the GUI based tools Norton Commander and Gnome Commander. This tool is very useful for file management on your remote server!

Midnight Commander is available for all major OSes, but the Ubuntu install goes like this:

goodgirl@winnie:~$ sudo apt-get install mc
[sudo] password for goodgirl: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
goodgirl@winnie:~$

 

Dealing with Linux/Unix Commands

It is not necessary to be a Linux expert to run a remote server, but it does help to understand the commands that you are using!

If you are a newcomer to Linux then you should work through some of the excellent tutorials found on line - Linux documentation and help is best found using a search engine!

An excellent background introduction to Linux, how the FOSS (Free and Open Source Software) community works, and how all of this differs from proprietary solutions (e.g. Windows and Second Life) can be found at Linux is NOT Windows

Further reading:

Introduction to the Linux Command Shell

A slide show with a more detailed introduction (includes a "cheat sheet")

The formal BASH (shell) manual

 

"Cheat Sheets"

Remembering all of these commands can be daunting for someone who is not used to using them on a daily basis.

One page command summaries (or "cheat sheets") can be very useful if you have some idea what you need to do:

Unix/Linux command cheat sheet

Ubuntu cheat sheet

 

Frequently Used Commands for managing a remote region

Most of the time you will only use a few special commands (mostly taken from the tutorial):

 

Quick check of the log files

tail is a command which lists the last 10 lines of a file:

goodgirl@winnie:~$ tail /var/log/monit.log
[MST Aug 29 15:43:04] error    : 'sim01' failed to start
[MST Aug 29 15:43:04] info     : Awakened by User defined signal 1
[MST Aug 29 15:43:04] info     : 'sim01' stop action done
[MST Aug 29 15:44:45] info     : start service 'sim01' on user request
[MST Aug 29 15:44:45] info     : monit daemon at 1707 awakened
[MST Aug 29 15:44:45] info     : Awakened by User defined signal 1
[MST Aug 29 15:44:45] info     : 'sim01' start: /bin/bash
[MST Aug 29 15:44:46] info     : 'sim01' started
[MST Aug 29 15:44:46] info     : 'sim01' start action done
[MST Aug 29 15:45:16] info     : 'sim01' process is running with pid 8339

The last line ""sim01' process is running with pid xxxx" is the one we want to see!

goodgirl@winnie:~$ tail /var/log/opensim/sim01.log
2011-08-29 15:45:56,695 DEBUG - OpenSim.Region.ScriptEngine.XEngine.XEngine [XEngine] 
...
goodgirl@winnie:~$

A quick check to see that OpenSim thinks all is well

 

 

Screen commands

Look for the shared screen console with

waki@NGIW:/opt/opensim/config$ screen -ls opensim/

Then connect to it with

waki@NGIW:/opt/opensim/config$ screen -r opensim/screen_console -A

 

 

Start the Simulator in a terminal for troubleshooting

It is very important to set the default directory as shown and we must run as user opensim.

This mode is recommended ONLY for troubleshooting since once you close the window (or the SSL link) the simulator will stop working!

waki@NGIW:/opt/opensim/config$ cd /opt/opensim/sim01/current/bin
waki@NGIW:/opt/opensim/sim01/current/bin$sudo -u opensim /usr/bin/mono OpenSim.exe

 

Make changes to scheduled tasks

ALWAYS CHECK to make sure you know what is already scheduled:

waki@NGIW:/opt/opensim/config$ sudo crontab -u opensim -l

Copy over the revised config file into the schedule (cron). Be sure to include the "-" at the end of the line, it is NOT a typo:

waki@NGIW:/opt/opensim/config$ cat /opt/opensim/config/opensim-crontab.txt | sudo crontab -u opensim -
waki@NGIW:/opt/opensim/config$ sudo crontab -u opensim -l

 

Start Monit

This should rarely be needed:

waki@NGIW:/opt/opensim/config$ sudo /etc/init.d/monit start

 

Backups of your Local Data

Backups can be simple or complex, this is a very simple minded backup using cron.

Every night it rolls each log file, and the sql backup, then creates a new sql backup from the MySql database and finally updates copies of the config files.

The /home hierarchy is used for the backups since I run separate partitions for the system stuff and the user's /home/*

 

Modified Log roll crontab

I modified the "log roll" in opensim-crontab.txt to use a utility designed for the function.

# to see current crontab for opensim
#  $ sudo crontab -u opensim -l
#
# to install this crontab for opensim:
#  $ cat /opt/opensim/config/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

 

New crontab to manage backups

Create a directory /home/opensim/backups which is accessible ONLY by root

goodgirl@winnie:/$ sudo mkdir /home/opensim/backups
goodgirl@winnie:/$ sudo mkdir /home/opensim/backups/config
goodgirl@winnie:/$ sudo chmod 0600 /home/opensim/backups
goodgirl@winnie:/$ sudo chmod 0600 /home/opensim/backups/config
goodgirl@winnie:/$ sudo ls -l /home/opensim/backups
[sudo] password for goodgirl: 
total 14860
drw------- 2 root root    4096 2011-08-29 14:15 config
-rw-r--r-- 1 root root 7605819 2011-08-29 01:10 OpensimBackup.sql
-rw------- 1 root root 7605831 2011-08-28 01:10 OpensimBackup.sql.0
goodgirl@winnie:/$ ls -l /home/opensim/backups/config
ls: cannot access /home/opensim/backups/config: Permission denied
goodgirl@winnie:/$ ls -l /home/opensim/backups
ls: cannot open directory /home/opensim/backups: Permission denied
goodgirl@winnie:/$  

 

Create a new "root-crontab.txt" file to handle backups and other log files. This MUST run as root to ensure good backups.

This file does 3 separate tasks:

(1) cycles present "monit.log" and "OpensimBackup.sql" file (2) creates a new dump of the MySql database for opensim (3) makes an updated copy of the config files

# to see current crontab for root
#  $ sudo crontab -u root -l
#
# to install this crontab for root:
#  $ cat /opt/opensim/config/root-crontab.txt | sudo crontab -u root -
#
# 
#minute	hour	mday	month	wday	command
# cycle the monit log
0 	0 	* 	* 	*       /usr/bin/savelog -c 7 /var/log/monit.log
# cycle the opensim database backup OpensimBackup.sql
10 	0 	* 	* 	*       /usr/bin/savelog -c 7 /home/opensim/backups/OpensimBackup.sql
# create a new opensim database backup
10 	1 	* 	* 	*       mysqldump -uroot -p****** -r /home/opensim/backups/OpensimBackup.sql opensim
# update the backup copy of the config files
5	1	*	*	*	sudo cp -u /opt/opensim/config/* /home/opensim/backups/config
tags: