aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-24 22:35:55 +0000
committerJustin Clark-Casey (justincc)2012-01-24 22:35:55 +0000
commit2d0412d366c1c243cc3abfe753f21d59b4c55473 (patch)
treedb1d27ecebbb66838e918aa30080176991c96723 /OpenSim
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-2d0412d366c1c243cc3abfe753f21d59b4c55473.zip
opensim-SC-2d0412d366c1c243cc3abfe753f21d59b4c55473.tar.gz
opensim-SC-2d0412d366c1c243cc3abfe753f21d59b4c55473.tar.bz2
opensim-SC-2d0412d366c1c243cc3abfe753f21d59b4c55473.tar.xz
Make errors reported by OpenSim when it halts because it can't find certain config sections or files a bit more user friendly.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs19
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs6
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs7
3 files changed, 12 insertions, 20 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 4a7c8b0..8d95c41 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -107,15 +107,13 @@ namespace OpenSim
107 } 107 }
108 else 108 else
109 { 109 {
110 m_log.ErrorFormat("Master ini file {0} not found", masterFilePath); 110 m_log.ErrorFormat("Master ini file {0} not found", Path.GetFullPath(masterFilePath));
111 Environment.Exit(1); 111 Environment.Exit(1);
112 } 112 }
113 } 113 }
114 } 114 }
115 115
116 116 string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini");
117 string iniFileName =
118 startupConfig.GetString("inifile", "OpenSim.ini");
119 117
120 if (IsUri(iniFileName)) 118 if (IsUri(iniFileName))
121 { 119 {
@@ -131,8 +129,7 @@ namespace OpenSim
131 if (!File.Exists(Application.iniFilePath)) 129 if (!File.Exists(Application.iniFilePath))
132 { 130 {
133 iniFileName = "OpenSim.xml"; 131 iniFileName = "OpenSim.xml";
134 Application.iniFilePath = Path.GetFullPath( 132 Application.iniFilePath = Path.GetFullPath(Path.Combine(Util.configDir(), iniFileName));
135 Path.Combine(Util.configDir(), iniFileName));
136 } 133 }
137 134
138 if (File.Exists(Application.iniFilePath)) 135 if (File.Exists(Application.iniFilePath))
@@ -142,15 +139,12 @@ namespace OpenSim
142 } 139 }
143 } 140 }
144 141
145 string iniDirName = 142 string iniDirName = startupConfig.GetString("inidirectory", "config");
146 startupConfig.GetString("inidirectory", "config"); 143 string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
147 string iniDirPath =
148 Path.Combine(Util.configDir(), iniDirName);
149 144
150 if (Directory.Exists(iniDirPath)) 145 if (Directory.Exists(iniDirPath))
151 { 146 {
152 m_log.InfoFormat("Searching folder {0} for config ini files", 147 m_log.InfoFormat("Searching folder {0} for config ini files", iniDirPath);
153 iniDirPath);
154 148
155 string[] fileEntries = Directory.GetFiles(iniDirName); 149 string[] fileEntries = Directory.GetFiles(iniDirName);
156 foreach (string filePath in fileEntries) 150 foreach (string filePath in fileEntries)
@@ -172,7 +166,6 @@ namespace OpenSim
172 if (sources.Count == 0) 166 if (sources.Count == 0)
173 { 167 {
174 m_log.FatalFormat("[CONFIG]: Could not load any configuration"); 168 m_log.FatalFormat("[CONFIG]: Could not load any configuration");
175 m_log.FatalFormat("[CONFIG]: Did you copy the OpenSimDefaults.ini.example file to OpenSimDefaults.ini?");
176 Environment.Exit(1); 169 Environment.Exit(1);
177 } 170 }
178 171
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 9f9b4f0..a680a59 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -202,16 +202,16 @@ namespace OpenSim
202 // Load the simulation data service 202 // Load the simulation data service
203 IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; 203 IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
204 if (simDataConfig == null) 204 if (simDataConfig == null)
205 throw new Exception("Configuration file is missing the [SimulationDataStore] section"); 205 throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
206 string module = simDataConfig.GetString("LocalServiceModule", String.Empty); 206 string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
207 if (String.IsNullOrEmpty(module)) 207 if (String.IsNullOrEmpty(module))
208 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section"); 208 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section.");
209 m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source }); 209 m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });
210 210
211 // Load the estate data service 211 // Load the estate data service
212 IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; 212 IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
213 if (estateDataConfig == null) 213 if (estateDataConfig == null)
214 throw new Exception("Configuration file is missing the [EstateDataStore] section"); 214 throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
215 module = estateDataConfig.GetString("LocalServiceModule", String.Empty); 215 module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
216 if (String.IsNullOrEmpty(module)) 216 if (String.IsNullOrEmpty(module))
217 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); 217 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index aeba35f..a6f4e47 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -126,11 +126,10 @@ namespace OpenSim.Server.Base
126 m_Config = new IniConfigSource(iniFile); 126 m_Config = new IniConfigSource(iniFile);
127 } 127 }
128 } 128 }
129 catch (Exception) 129 catch (Exception e)
130 { 130 {
131 System.Console.WriteLine("Error reading from config source {0}", 131 System.Console.WriteLine("Error reading from config source. {0}", e.Message);
132 iniFile); 132 Environment.Exit(1);
133 Thread.CurrentThread.Abort();
134 } 133 }
135 134
136 // Merge the configuration from the command line into the 135 // Merge the configuration from the command line into the