Added -setuponly switch to gridserver

KILLED THE GRIDSERVER'S CONSOLE VICIOUSLY AND WITHOUT MERCY!!!!
Added gridserver setup to InitSetup() in ServiceManager
zircon^2
gareth 2007-05-14 01:50:13 +00:00
parent d95d59db3b
commit 5ba3fa9629
2 changed files with 16 additions and 7 deletions

View File

@ -32,6 +32,7 @@ using System.IO;
using System.Text;
using System.Timers;
using System.Net;
using System.Threading;
using System.Reflection;
using libsecondlife;
using OpenSim.Framework;
@ -51,6 +52,7 @@ namespace OpenGridServices.GridServer
public GridConfig Cfg;
public static OpenGrid_Main thegrid;
public static bool setuponly;
//public LLUUID highestUUID;
@ -63,7 +65,8 @@ namespace OpenGridServices.GridServer
[STAThread]
public static void Main(string[] args)
{
Console.WriteLine("Starting...\n");
if(args[0]=="-setuponly") setuponly=true;
Console.WriteLine("Starting...\n");
thegrid = new OpenGrid_Main();
thegrid.Startup();
@ -73,11 +76,10 @@ namespace OpenGridServices.GridServer
private void Work()
{
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"\nEnter help for a list of commands\n");
while (true)
{
m_console.MainConsolePrompt();
Thread.Sleep(5000);
// should flush the DB etc here
}
}
@ -94,6 +96,7 @@ namespace OpenGridServices.GridServer
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Loading configuration");
Cfg = this.LoadConfigDll(this.ConfigDll);
Cfg.InitConfig();
if(setuponly) Environment.Exit(0);
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Connecting to Storage Server");
m_gridManager = new GridManager();
@ -129,7 +132,7 @@ namespace OpenGridServices.GridServer
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting sim status checker");
Timer simCheckTimer = new Timer( 300000 ); // 5 minutes
System.Timers.Timer simCheckTimer = new System.Timers.Timer( 300000 ); // 5 minutes
simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
simCheckTimer.Enabled = true;
}

View File

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.ServiceProcess;
using System.Xml;
@ -65,8 +66,13 @@ public class OpenGridMasterService : System.ServiceProcess.ServiceBase {
private static string SetupGrid()
{
Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server");
// TODO: Drop the console! and then configure using CLI params and/or XML files
return "<grid></grid>";
Process p = new Process();
p.StartInfo.Arguments = "-setuponly";
p.StartInfo.FileName = "OpenGridServices.GridServer.exe";
p.Start();
return "<gridserver />"; // we let the gridserver handle it's own setup
}
private static string SetupUser()