aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base
diff options
context:
space:
mode:
authorUbitUmarov2017-04-25 17:59:53 +0100
committerUbitUmarov2017-04-25 17:59:53 +0100
commita680d8b8d700f78beb1a9eea98b52d59118efe2e (patch)
treedd084e74fb61400c704a14dcfa8689670acb9ec2 /OpenSim/Server/Base
parentMerge branch 'master' into httptests (diff)
parentmove mesh pbs creation code out of mesh upload code into to PrimitiveBaseShap... (diff)
downloadopensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.zip
opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.gz
opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.bz2
opensim-SC-a680d8b8d700f78beb1a9eea98b52d59118efe2e.tar.xz
fix merge
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index f60b5fb..d151de6 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -61,6 +61,9 @@ namespace OpenSim.Server.Base
61 // 61 //
62 private bool m_Running = true; 62 private bool m_Running = true;
63 63
64 private static Mono.Unix.UnixSignal[] signals;
65
66
64 // Handle all the automagical stuff 67 // Handle all the automagical stuff
65 // 68 //
66 public ServicesServerBase(string prompt, string[] args) : base() 69 public ServicesServerBase(string prompt, string[] args) : base()
@@ -183,6 +186,39 @@ namespace OpenSim.Server.Base
183 RegisterCommonCommands(); 186 RegisterCommonCommands();
184 RegisterCommonComponents(Config); 187 RegisterCommonComponents(Config);
185 188
189 Thread signal_thread = new Thread (delegate ()
190 {
191 while (true)
192 {
193 // Wait for a signal to be delivered
194 int index = Mono.Unix.UnixSignal.WaitAny (signals, -1);
195
196 //Mono.Unix.Native.Signum signal = signals [index].Signum;
197 ShutdownSpecific();
198 m_Running = false;
199 Environment.Exit(0);
200 }
201 });
202
203 if(!Util.IsWindows())
204 {
205 try
206 {
207 // linux mac os specifics
208 signals = new Mono.Unix.UnixSignal[]
209 {
210 new Mono.Unix.UnixSignal(Mono.Unix.Native.Signum.SIGTERM)
211 };
212 signal_thread.Start();
213 }
214 catch (Exception e)
215 {
216 m_log.Info("Could not set up UNIX signal handlers. SIGTERM will not");
217 m_log.InfoFormat("shut down gracefully: {0}", e.Message);
218 m_log.Debug("Exception was: ", e);
219 }
220 }
221
186 // Allow derived classes to perform initialization that 222 // Allow derived classes to perform initialization that
187 // needs to be done after the console has opened 223 // needs to be done after the console has opened
188 Initialise(); 224 Initialise();