From 313a635d1ec368b14a1678bdf7813138972f3bbc Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 9 May 2008 13:21:12 +0000 Subject: * Fix opensim region server shutdown. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 2 +- OpenSim/Grid/GridServer/GridServerBase.cs | 2 +- OpenSim/Grid/MessagingServer/Main.cs | 2 +- OpenSim/Grid/UserServer/Main.cs | 2 +- OpenSim/Region/Application/OpenSimMain.cs | 24 +++++++--------------- OpenSim/Region/Application/OpenSimMainConsole.cs | 26 ------------------------ 6 files changed, 11 insertions(+), 47 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 2069c0e..af25ef4 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -52,7 +52,7 @@ namespace OpenSim.Framework.Servers /// /// Should be overriden by descendents if they need to perform extra shutdown processing /// - protected virtual void Shutdown() + public virtual void Shutdown() { m_console.Close(); Environment.Exit(0); diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 49c53e9..5517953 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -178,7 +178,7 @@ namespace OpenSim.Grid.GridServer */ } - protected override void Shutdown() + public override void Shutdown() { foreach (IGridPlugin plugin in m_plugins) plugin.Close(); diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 22a7d9c..9020ca4 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -142,7 +142,7 @@ namespace OpenSim.Grid.MessagingServer } } - protected override void Shutdown() + public override void Shutdown() { msgsvc.deregisterWithUserServer(); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index b6f59e1..e1ccd02 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -244,7 +244,7 @@ namespace OpenSim.Grid.UserServer } } - protected override void Shutdown() + public override void Shutdown() { m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index adfddcb..ec26d9d 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -330,20 +330,14 @@ namespace OpenSim // We are done with startup m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); + WorldHasComeToAnEnd.WaitOne(); m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); + Environment.Exit(0); } /// - /// Signal that the end of the world is now. - /// - public void ApocalypseNow() - { - WorldHasComeToAnEnd.Set(); - } - - /// /// Print the version information available to the library. This include a subversion number if the root /// .svn/entries file is present. /// @@ -689,7 +683,7 @@ namespace OpenSim /// /// Performs any last-minute sanity checking and shuts down the region server /// - protected virtual void InternalShutdown() + public override void Shutdown() { if (proxyUrl.Length > 0) { @@ -703,14 +697,10 @@ namespace OpenSim m_log.Info("[SHUTDOWN]: Closing console and terminating"); m_sceneManager.Close(); - // needs to be called by Shutdown() method - // Environment.Exit(0); - } - - public virtual void Shutdown() - { - InternalShutdown(); - ApocalypseNow(); + + WorldHasComeToAnEnd.Set(); + + base.Shutdown(); } /// diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs index c02095c..f33441f 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSimMainConsole.cs @@ -120,32 +120,6 @@ namespace OpenSim return new ConsoleBase("Region", this); } - /// - /// Performs any last-minute sanity checking and shuts down the region server - /// - public override void Shutdown() - { - if (m_startupCommandsFile != String.Empty) - { - RunCommandScript(m_shutdownCommandsFile); - } - - if (proxyUrl.Length > 0) - { - Util.XmlRpcCommand(proxyUrl, "Stop"); - } - - m_log.Info("[SHUTDOWN]: Closing all threads"); - m_log.Info("[SHUTDOWN]: Killing listener thread"); - m_log.Info("[SHUTDOWN]: Killing clients"); - // TODO: implement this - m_log.Info("[SHUTDOWN]: Closing console and terminating"); - - m_sceneManager.Close(); - - base.Shutdown(); - } - private void RunAutoTimerScript(object sender, EventArgs e) { if (m_timedScript != "disabled") -- cgit v1.1