[Opensim-dev] Feature Request ...

Develope Develope at Ashuan.de
Sun Dec 21 12:20:40 UTC 2008


@Tedd 
	Thank you  ... i didn't see this implementation :)

@Kyle
	hey hey keep Cool. 
	You must not explain how to implement simple things. My question only is if its useful to do that.
	If there is no Implementation in mono for this ... It's all clear for me

I´ll take a look at the OpenSim\Tools\OpenSim.GridLaunch and use this or do an forge project.

Thanks @All

Kai


-----Original Message-----
From: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Tedd Hansen
Sent: Sonntag, 21. Dezember 2008 12:07
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] Feature Request ...

Have a looksie in folder: OpenSim\Tools\OpenSim.GridLaunch
File: GUI\Service\Service.cs

There is a uncomplete service implementation that just needs a few lines
to be completed.
GridLaunch project was added as an optional execution method for easing
execution on Windows/*nix, not sure if it is something I will follow up
as I see other projects like OpenSim.GUI on forge.

The idea was to have GUI modules such as Console, WinForms, Service,
etc. You choose module from config or on command line.

BR,
 Tedd

-----Original Message-----
From: opensim-dev-bounces at lists.berlios.de
[mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Develope
Sent: 21. desember 2008 08:32
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] Feature Request ...

Hi,

thank you for answering so fast ...

@Kyle Hamilton
1. You can also use srvany.exe from Microsoft to turn any .exe into a
service.  http://www.iopus.com/guides/srvany.htm has information.
	
---	If you do that, you are not able to control your service like
OnStart(). The Memoryallocation in "real" Services (ServiceBase) is much
faster 	than them doing under srvany. There are many other drawbacks
using srvany.exe (Logging, dependencies, rightsmanagement, installation
...)

@ Stefan Andersson
2) To be able to do so, you should implement the services as 'wrappers',
separate applications that _use_ the Main Classes, not change or expand
on them, like for example for the grid service wrapper:
 
    partial class GridServ : ServiceBase
    {
        private GridServerBase m_gridApplication;

        protected override void OnStart(string[] args)
        {
            // Define working directory (For a service, this is set to
System dir by default...)
            Process pc = Process.GetCurrentProcess();
            string useDirectory = pc.MainModule.FileName.Substring(0,
pc.MainModule.FileName.LastIndexOf(@"\"));
            Directory.SetCurrentDirectory(useDirectory);
            log4net.Config.XmlConfigurator.Configure();
            m_gridApplication = new GridServerBase();
            m_gridApplication.Startup();
        }
   }
 
(This snippet taken from Tribal Medias proprietary service wrappers -
feel free to copy+paste.)
	
---	It is impossible to not change the main applications, cause they
all went into 
	  public void Work()
        {
            m_console.Notice("Enter help for a list of commands\n");

            while (true)
            {
                m_console.Prompt();
            }
        }

	Holding a Service into a loop or in console.readline make the
OnStart() not responsable for the machine and nothing runs.

---  Is the System.ServiceProcess not implemented in Mono ? If so there
is no problem doing this. In my solution all executables are running as
service and doing well (Win 2003). I try to evaluate how it works in
mono.

--- My implementation is:
	Here is the first bad hack
	    public /*abstract*/ class BaseOpenSimServer :
System.ServiceProcess.ServiceBase
		{
		...
			public static void RunService(BaseOpenSimServer
pInstance, string[] args)
			{
			...
			}
		...
		}

	In case of Gridserver ...
        public static void Main(string[] args)
        {
            XmlConfigurator.Configure();

            GridServerBase.RunService(new GridServerBase(), args);

            //GridServerBase app = new GridServerBase();

		//app.Startup();
		//app.Work();
        }
		Thats all.
---	You can now start your application with parameter '/Install' or
'/unistall' to create this service or to uninstall it.
--- You chose if it starts as a service and how its name an dependencies
only in app.config of the diffrent projects.
	If you dont want to run this as service switch in app.config.


Greetz

Kai


-----Original Message-----
From: opensim-dev-bounces at lists.berlios.de
[mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Kyle Hamilton
Sent: Sonntag, 21. Dezember 2008 00:24
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] Feature Request ...

You can also use srvany.exe from Microsoft to turn any .exe into a
service.  http://www.iopus.com/guides/srvany.htm has information.

-Kyle H

On Sat, Dec 20, 2008 at 1:13 PM, Stefan Andersson
<stefan at tribalmedia.se> wrote:
> Excellent! We really need windows service wrappers for the various
exe's.
>
> A couple of pointers:
>
> 1) Since this is (in practice) a windows-only project, you should
implement
> this as a 'forge' project;
> http://forge.opensimulator.org/gf/
>
> 2) To be able to do so, you should implement the services as
'wrappers',
> separate applications that _use_ the Main Classes, not change or
expand on
> them, like for example for the grid service wrapper:
>
>     partial class GridServ : ServiceBase
>     {
>         private GridServerBase m_gridApplication;
>
>         protected override void OnStart(string[] args)
>         {
>             // Define working directory (For a service, this is set to
> System dir by default...)
>             Process pc = Process.GetCurrentProcess();
>             string useDirectory = pc.MainModule.FileName.Substring(0,
> pc.MainModule.FileName.LastIndexOf(@"\"));
>             Directory.SetCurrentDirectory(useDirectory);
>             log4net.Config.XmlConfigurator.Configure();
>             m_gridApplication = new GridServerBase();
>             m_gridApplication.Startup();
>         }
>    }
>
> (This snippet taken from Tribal Medias proprietary service wrappers -
feel
> free to copy+paste.)
>
> 3) When you've done the wrappers, the next step is to add a method to
> communicate with the consoles. One way to go about it is to have the
service
> process redirect the console in and output to a named pipe, and then
supply
> a console app that listens/writes to those pipes.
>
> Best regards,
> Stefan Andersson
> Tribal Media AB
>
>
> ________________________________
> Date: Sat, 20 Dec 2008 19:53:32 +0100
> From: Develope at Ashuan.de
> To: Opensim-dev at lists.berlios.de
> Subject: [Opensim-dev] Feature Request ...
>
>
> Hi Friends,
>
>
>
> i wish to implement the feature to run all Gridcomponents (Userserver,
> Assetserver ....) as a Service.
>
> My work is now only to evaluate how easy or not it is ... it is easy
.. but
> ...
>
>
>
> I must add an Reference to the System.ServiceProcess in several
Project.
>
> Now my question ...
>
>
>
> Is there a Problem doing this?
>
> And second how do i include an reference into a .patch-File?
>
>
>
> Kai
>
>
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev



More information about the Opensim-dev mailing list