aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGridServices.GridServer/Main.cs13
-rw-r--r--ServiceManager/ServiceManager.cs10
2 files changed, 16 insertions, 7 deletions
diff --git a/OpenGridServices.GridServer/Main.cs b/OpenGridServices.GridServer/Main.cs
index f7b0067..1a2a0fb 100644
--- a/OpenGridServices.GridServer/Main.cs
+++ b/OpenGridServices.GridServer/Main.cs
@@ -32,6 +32,7 @@ using System.IO;
32using System.Text; 32using System.Text;
33using System.Timers; 33using System.Timers;
34using System.Net; 34using System.Net;
35using System.Threading;
35using System.Reflection; 36using System.Reflection;
36using libsecondlife; 37using libsecondlife;
37using OpenSim.Framework; 38using OpenSim.Framework;
@@ -51,6 +52,7 @@ namespace OpenGridServices.GridServer
51 public GridConfig Cfg; 52 public GridConfig Cfg;
52 53
53 public static OpenGrid_Main thegrid; 54 public static OpenGrid_Main thegrid;
55 public static bool setuponly;
54 56
55 //public LLUUID highestUUID; 57 //public LLUUID highestUUID;
56 58
@@ -63,7 +65,8 @@ namespace OpenGridServices.GridServer
63 [STAThread] 65 [STAThread]
64 public static void Main(string[] args) 66 public static void Main(string[] args)
65 { 67 {
66 Console.WriteLine("Starting...\n"); 68 if(args[0]=="-setuponly") setuponly=true;
69 Console.WriteLine("Starting...\n");
67 70
68 thegrid = new OpenGrid_Main(); 71 thegrid = new OpenGrid_Main();
69 thegrid.Startup(); 72 thegrid.Startup();
@@ -73,11 +76,10 @@ namespace OpenGridServices.GridServer
73 76
74 private void Work() 77 private void Work()
75 { 78 {
76 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"\nEnter help for a list of commands\n");
77
78 while (true) 79 while (true)
79 { 80 {
80 m_console.MainConsolePrompt(); 81 Thread.Sleep(5000);
82 // should flush the DB etc here
81 } 83 }
82 } 84 }
83 85
@@ -94,6 +96,7 @@ namespace OpenGridServices.GridServer
94 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Loading configuration"); 96 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Loading configuration");
95 Cfg = this.LoadConfigDll(this.ConfigDll); 97 Cfg = this.LoadConfigDll(this.ConfigDll);
96 Cfg.InitConfig(); 98 Cfg.InitConfig();
99 if(setuponly) Environment.Exit(0);
97 100
98 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Connecting to Storage Server"); 101 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Connecting to Storage Server");
99 m_gridManager = new GridManager(); 102 m_gridManager = new GridManager();
@@ -129,7 +132,7 @@ namespace OpenGridServices.GridServer
129 132
130 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting sim status checker"); 133 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting sim status checker");
131 134
132 Timer simCheckTimer = new Timer( 300000 ); // 5 minutes 135 System.Timers.Timer simCheckTimer = new System.Timers.Timer( 300000 ); // 5 minutes
133 simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); 136 simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
134 simCheckTimer.Enabled = true; 137 simCheckTimer.Enabled = true;
135 } 138 }
diff --git a/ServiceManager/ServiceManager.cs b/ServiceManager/ServiceManager.cs
index 6cd2113..b21a5b1 100644
--- a/ServiceManager/ServiceManager.cs
+++ b/ServiceManager/ServiceManager.cs
@@ -1,4 +1,5 @@
1using System; 1using System;
2using System.Diagnostics;
2using System.Threading; 3using System.Threading;
3using System.ServiceProcess; 4using System.ServiceProcess;
4using System.Xml; 5using System.Xml;
@@ -65,8 +66,13 @@ public class OpenGridMasterService : System.ServiceProcess.ServiceBase {
65 private static string SetupGrid() 66 private static string SetupGrid()
66 { 67 {
67 Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server"); 68 Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server");
68 // TODO: Drop the console! and then configure using CLI params and/or XML files 69 Process p = new Process();
69 return "<grid></grid>"; 70
71 p.StartInfo.Arguments = "-setuponly";
72 p.StartInfo.FileName = "OpenGridServices.GridServer.exe";
73 p.Start();
74
75 return "<gridserver />"; // we let the gridserver handle it's own setup
70 } 76 }
71 77
72 private static string SetupUser() 78 private static string SetupUser()