From cdfdf6322defc614a1261a38c710bf3f73cd4dc7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 09:26:12 +0000 Subject: Applying a modified version of TomTheDragon's patch to prevent the sim from crashing when signals are unavailable. --- OpenSim/Region/Application/OpenSim.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index aba09e0..3cb999b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -131,7 +131,6 @@ namespace OpenSim private Thread signal_thread = new Thread (delegate () { - System.Console.WriteLine("------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"); while (true) { // Wait for a signal to be delivered @@ -153,13 +152,21 @@ namespace OpenSim if(!Util.IsWindows()) { - // linux mac os specifics - signals = new Mono.Unix.UnixSignal[] + try { -// new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGINT), - new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) - }; - signal_thread.Start(); + // linux mac os specifics + signals = new Mono.Unix.UnixSignal[] + { + new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM) + }; + signal_thread.Start(); + } + catch (Exception e) + { + m_log.Info("Could not set up UNIX signal handlers. SIGTERM will not"); + m_log.InfoFormat("shut down gracefully: {0}", e.Message); + m_log.Debug("Exception was: ", e); + } } //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx -- cgit v1.1