From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 73 +++++++++++++++++--------- 1 file changed, 49 insertions(+), 24 deletions(-) (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 5ce978e..81dd357 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -65,11 +65,12 @@ namespace OpenSim.Framework.Servers /// This will control a periodic log printout of the current 'show stats' (if they are active) for this /// server. /// + private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); - + /// - /// Random uuid for private data + /// Random uuid for private data /// protected string m_osSecret = String.Empty; @@ -83,9 +84,8 @@ namespace OpenSim.Framework.Servers { // Random uuid for private data m_osSecret = UUID.Random().ToString(); - } - + /// /// Must be overriden by child classes for their own server specific startup behaviour. /// @@ -104,26 +104,33 @@ namespace OpenSim.Framework.Servers m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS; m_periodicDiagnosticsTimer.Enabled = true; } - } + } protected override void ShutdownSpecific() - { - m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); + { + Watchdog.Enabled = false; + base.ShutdownSpecific(); + + MainServer.Stop(); + + Thread.Sleep(5000); + Util.StopThreadPool(); + WorkManager.Stop(); + Thread.Sleep(1000); RemovePIDFile(); - base.ShutdownSpecific(); + m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); - if (!SuppressExit) - System.Diagnostics.Process.GetCurrentProcess().Kill(); -//// Environment.Exit(0); + if (!SuppressExit) + Environment.Exit(0); } - + /// /// Provides a list of help topics that are available. Overriding classes should append their topics to the /// information returned when the base method is called. /// - /// + /// /// /// A list of strings that represent different help topics on which more information is available /// @@ -147,20 +154,38 @@ namespace OpenSim.Framework.Servers /// Performs initialisation of the scene, such as loading configuration from disk. /// public virtual void Startup() - { - StartupSpecific(); - + { + m_log.Info("[STARTUP]: Beginning startup processing"); + + m_log.Info("[STARTUP]: version: " + m_version + Environment.NewLine); + // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and + // the clr version number doesn't match the project version number under Mono. + //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); + m_log.InfoFormat( + "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n", + Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32"); + + try + { + StartupSpecific(); + } + catch(Exception e) + { + m_log.Fatal("Fatal error: " + e.ToString()); + Environment.Exit(1); + } + TimeSpan timeTaken = DateTime.Now - m_startuptime; - - MainConsole.Instance.OutputFormat( - "PLEASE WAIT FOR LOGINS TO BE ENABLED ON REGIONS ONCE SCRIPTS HAVE STARTED. Non-script portion of startup took {0}m {1}s.", - timeTaken.Minutes, timeTaken.Seconds); + +// MainConsole.Instance.OutputFormat( +// "PLEASE WAIT FOR LOGINS TO BE ENABLED ON REGIONS ONCE SCRIPTS HAVE STARTED. Non-script portion of startup took {0}m {1}s.", +// timeTaken.Minutes, timeTaken.Seconds); } - public string osSecret + public string osSecret { // Secret uuid for the simulator - get { return m_osSecret; } + get { return m_osSecret; } } public string StatReport(IOSHttpRequest httpRequest) @@ -169,8 +194,8 @@ namespace OpenSim.Framework.Servers if (httpRequest.Query.ContainsKey("callback")) { return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");"; - } - else + } + else { return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); } -- cgit v1.1