diff options
author | Justin Clark-Casey (justincc) | 2012-11-22 05:14:08 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-22 05:14:43 +0000 |
commit | 8269d2b893af47ad44e66a7918d472086adaddbb (patch) | |
tree | ca9566b749a05f4ac0168fa2d058e30ba6ff71d3 /OpenSim/Framework/Servers/BaseOpenSimServer.cs | |
parent | Add "get log level" command - this returns the current server session console... (diff) | |
download | opensim-SC-8269d2b893af47ad44e66a7918d472086adaddbb.zip opensim-SC-8269d2b893af47ad44e66a7918d472086adaddbb.tar.gz opensim-SC-8269d2b893af47ad44e66a7918d472086adaddbb.tar.bz2 opensim-SC-8269d2b893af47ad44e66a7918d472086adaddbb.tar.xz |
Factor out common pid file creation and removal code.
Log path at which pid file is created or reason for failure to create.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 8bdda29..89d3507 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -61,8 +61,6 @@ namespace OpenSim.Framework.Servers | |||
61 | /// server. | 61 | /// server. |
62 | /// </summary> | 62 | /// </summary> |
63 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); | 63 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); |
64 | |||
65 | protected string m_pidFile = String.Empty; | ||
66 | 64 | ||
67 | /// <summary> | 65 | /// <summary> |
68 | /// Random uuid for private data | 66 | /// Random uuid for private data |
@@ -293,23 +291,6 @@ namespace OpenSim.Framework.Servers | |||
293 | MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId); | 291 | MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId); |
294 | } | 292 | } |
295 | 293 | ||
296 | protected void CreatePIDFile(string path) | ||
297 | { | ||
298 | try | ||
299 | { | ||
300 | string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); | ||
301 | FileStream fs = File.Create(path); | ||
302 | |||
303 | Byte[] buf = Encoding.ASCII.GetBytes(pidstring); | ||
304 | fs.Write(buf, 0, buf.Length); | ||
305 | fs.Close(); | ||
306 | m_pidFile = path; | ||
307 | } | ||
308 | catch (Exception) | ||
309 | { | ||
310 | } | ||
311 | } | ||
312 | |||
313 | public string osSecret { | 294 | public string osSecret { |
314 | // Secret uuid for the simulator | 295 | // Secret uuid for the simulator |
315 | get { return m_osSecret; } | 296 | get { return m_osSecret; } |
@@ -327,20 +308,5 @@ namespace OpenSim.Framework.Servers | |||
327 | return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); | 308 | return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); |
328 | } | 309 | } |
329 | } | 310 | } |
330 | |||
331 | protected void RemovePIDFile() | ||
332 | { | ||
333 | if (m_pidFile != String.Empty) | ||
334 | { | ||
335 | try | ||
336 | { | ||
337 | File.Delete(m_pidFile); | ||
338 | m_pidFile = String.Empty; | ||
339 | } | ||
340 | catch (Exception) | ||
341 | { | ||
342 | } | ||
343 | } | ||
344 | } | ||
345 | } | 311 | } |
346 | } | 312 | } \ No newline at end of file |