[Opensim-users] Running opensim as a service

Scott T. Norman scott at scottnorman.com
Tue Jan 8 01:39:38 UTC 2008


Look at this page for Automating  OpenSim startup, I'm not  sure about  
accessing the consoles with Windows after  running start. I  have my  
own Linux sever running  OpenSim going and using the  Screen Command  
works fine for me. I ssh in and can get to the consoles. Though I   
would agree it wouldn't probably hurt to have a remote console or  
maybe even a web based console to  help in managing OpenSim.

http://opensimulator.org/wiki/OpenSim:Configuration

Windows
Create a file called StartGrid.BAT:
start OpenSim.Grid.UserServer.exe sleep 3 start  
OpenSim.Grid.GridServer.exe sleep 3 start OpenSim.Grid.AssetServer.exe  
sleep 3 start OpenSim.Grid.InventoryServer.exe sleep 3 start  
OpenSim.exe -gridmode=true
PS! Check that you have sleep command installed, I'm unsure if all  
Windows versions have that.
This knowledgebase article describes how to add a batch file to  
startup of Windows (before logon).
http://support.microsoft.com/kb/q243486/
Note that you have to start all applications and answer the  
configuration questions once before adding it to any startup.

If you start the server before logon then there will be no window to  
close if you want to shut down the server, so you can create a  
"StopGrid.BAT" with:
taskkill /FI "IMAGENAME eq OpenSim.*" sleep 3 taskkill /FI "IMAGENAME  
eq OpenSim.*" sleep 3 taskkill /F /FI "IMAGENAME eq OpenSim.*"

Linux/Mac OS X Use Screen Command
Use the screen command to automate startup
[edit]Setup screen command and setup shell file
screen install:
Linux
apt-get install screen
Mac OS X: Download either MacPorts, http://www.macports.org/, or Fink, http://www.finkproject.org/ 
  to download *nix packages MacPorts
sudo port install screen
Fink
Need command line for Fink.
Create file runsim.sh
#!/bin/sh cd opensim/bin sleep 3 screen -S UserServer -d -m mono  
OpenSim.Grid.UserServer.exe sleep 3 screen -S GridServer -d -m mono  
OpenSim.Grid.GridServer.exe sleep 3 screen -S AssetServer -d -m mono  
OpenSim.Grid.AssetServer.exe sleep 3 screen -S InventoryServer -d -m  
mono OpenSim.Grid.InventoryServer.exe sleep 3 screen -S OpenSim -d -m  
mono OpenSim.exe -gridmode=true
[edit]Startup and access servers
./runsim.sh
If you have permission issues
chmod 755 runsim.sh
To see a list of the servers in screen:
screen -ls or screen -list
Output will look like the following:
There are screens on: 8419.OpenSim (Detached) 8403.InventoryServer  
(Detached) 8378.AssetServer (Detached) 8360.GridServer (Detached)  
8347.UserServer (Detached)
To access server
screen -r 8419.OpenSim screen -r 8403.InventoryServer etc.
To exit screen, leaving server running, and to return to shell
ctrl-a d
[edit]Shutdown Servers
Either manually access each sceen
screen -r 8419.OpenSim shutdown
Or use
killall mono
Or
for i in `ps afxu | grep -i "mono.*OpenSim" | grep -v grep | awk  
{'print $2'}`; do kill $i; done
Need to see if there is a way to use a shell script using screen to  
shutdown servers

Blessings,

Scott
www.scottnorman.com

God's covenant of revival fire has fallen upon Orange County,  
California, so that the Church of Orange County will become one and  
bring healing, salvation, and redemption to the county, and to take  
part in the harvest of one billion plus souls into the Kingdom of God.  
- Scott Norman



On Jan 7, 2008, at 11:58 AM, Garth FairChang wrote:

> Hi and thanks for your replies
>
> I feel we need a remote console (similar to games like quake, unreal  
> dedicated servers) to administrate our servers.
>
> I see there are remote settings in the  opensim.ini file. how do you  
> use that to contact/control the server?
> What do the do?
>
> Garth FairChang
>
> Impalah wrote:
>>
>> Let me be pessimist about this method... I think (I haven't tried,  
>> of course, it's only experience) that you couldn't obtain access to  
>> the console in "operation" mode (if you configure the .bat as  
>> "interactive" you'll get the starting messages, but anything more).  
>> It's almost the same as ANYSRV...
>>
>> That's why I ask for the "Linux" guys. I supose in Linux the server  
>> is started after Linux boot but I don't know if they have access to  
>> the console.
>>
>> Unless there is some magic way for OS administration without the  
>> console we will be very limited in the future for install it into  
>> production servers. Tell a SysOp that you need to get your used  
>> logged "ad infinitum" in a server and watch his red burning killer  
>> eyes.
>>
>> Greetings
>>
>>
>>
>> 2008/1/7, Roger Schreiner <phillygeekx at gmail.com>:
>> Curious to know the reasoning to run this as a service?  If it is  
>> nothing more then to have the OS server start when the system  
>> reboots without login to the server, instead of running it as a  
>> service this can be run through a windows batch file and the NOS  
>> can be configured to run the batch file in a maximazed mode at  
>> start up prior to login, so it should load as cmd console  
>> application and provide you with administration control via this  
>> cmd console window. While this doesn't do much good for monitoring  
>> a service or restarting an application on failure, it should allow  
>> the server to start without intervention on the reboot.
>>
>> Running a batch File before login  =  http://support.microsoft.com/kb/q243486/
>> Creating a batch file =  http://home.att.net/~gobruen/progs/dos_batch/dos_batch.html
>> I haven't tired it but when i find some time i will post a pastebin  
>> copy of the code and add the proceedure text when i can find  some  
>> time.
>>
>> Tworsley
>>
>>
>> On Jan 7, 2008 5:38 AM, Impalah <impalah at gmail.com > wrote:
>> You won't have access in any case to the console if you launch OS  
>> as a service. OS will need a "configuration service" apart from the  
>> console.
>>
>> How Linux guys solve this problem??? They must not have access to  
>> the console, I supose.
>>
>>
>>
>> 2008/1/6, Garth FairChang <garth at fairchang.com>:
>> Hi and thanks
>>
>> I have tried that. But after a while OpenSim.exe just seems to  
>> close and if I use remote window it is not there.
>>
>> What do you have the idle time set at on plesk?
>>
>> Also I found a great application that works with Windows server  
>> 2003.  http://www.application-as-service.com/
>> I am testing the demo 14 day version. Works well but I have no  
>> access to the opensim window. It looks like you could load the  
>> other opensim servers in order as services before loading  
>> Opensim.exe :)
>>
>> Garth FairChang
>> www.fairchang.com
>>
>> jean-françois peri wrote:
>>> Hi
>>>
>>> I have Opensim running on plesk on Windows server 2003 and I have  
>>> not this problem.
>>> Simply when you leave windows on your local computer dont stop it  
>>> just click on the cross on the top right of your screen.
>>> Opensim server will continue to run
>>>
>>> Le 5 janv. 08 à 03:37, Impalah a écrit :
>>>
>>>> I haven't tried yet with OS but...
>>>>
>>>> http://support.microsoft.com/kb/137890
>>>>
>>>> ANYSRV, to run any program as a service
>>>>
>>>>
>>>> 2008/1/5, Garth <garth at fairchang.com>:
>>>> Hi
>>>>
>>>> Is it possible to run opensim.exe (and the database programs) as  
>>>> a windows
>>>> service?
>>>>
>>>> I am using a windows 2003 server and every time I logout of the  
>>>> remote
>>>> window (in plesk) after a short time the server is gone.
>>>>
>>>> I am guessing it is closing the session.
>>>>
>>>> Garth FairChang
>>>>
>>>> ________________________________________________
>>>> Message sent using UebiMiau 2.7.9
>>>>
>>>>
>>>> _______________________________________________
>>>> Opensim-users mailing list
>>>> Opensim-users at lists.berlios.de
>>>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>>>
>>>> _______________________________________________
>>>> Opensim-users mailing list
>>>> Opensim-users at lists.berlios.de
>>>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>>
>>> _______________________________________________
>>> Opensim-users mailing list
>>> Opensim-users at lists.berlios.de
>>>
>>>
>>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.5.516 / Virus Database: 269.17.12/1203 - Release Date:  
>>> 12/30/2007 11:27 AM
>>>
>>
>> _______________________________________________
>>
>> Opensim-users mailing list
>> Opensim-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>
>>
>>
>> _______________________________________________
>> Opensim-users mailing list
>> Opensim-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/opensim-users
>>
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date:  
>> 1/6/2008 10:55 PM
>>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20080107/9dd1a0ef/attachment.html>


More information about the Opensim-users mailing list