passenger 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (100) hide show
  1. data/NEWS +31 -1
  2. data/bin/passenger-install-apache2-module +7 -1
  3. data/bin/passenger-install-nginx-module +1 -1
  4. data/bin/passenger-memory-stats +3 -3
  5. data/doc/Users guide Apache.html +112 -13
  6. data/doc/Users guide Apache.txt +70 -9
  7. data/doc/Users guide Nginx.html +1 -1
  8. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  9. data/doc/cxxapi/Configuration_8h-source.html +1 -1
  10. data/doc/cxxapi/DirectoryMapper_8h-source.html +7 -7
  11. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  12. data/doc/cxxapi/annotated.html +1 -1
  13. data/doc/cxxapi/classHooks-members.html +1 -1
  14. data/doc/cxxapi/classHooks.html +1 -1
  15. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  17. data/doc/cxxapi/classes.html +1 -1
  18. data/doc/cxxapi/definitions_8h-source.html +1 -1
  19. data/doc/cxxapi/files.html +1 -1
  20. data/doc/cxxapi/functions.html +1 -1
  21. data/doc/cxxapi/functions_func.html +1 -1
  22. data/doc/cxxapi/graph_legend.html +1 -1
  23. data/doc/cxxapi/group__Configuration.html +1 -1
  24. data/doc/cxxapi/group__Core.html +1 -1
  25. data/doc/cxxapi/group__Hooks.html +1 -1
  26. data/doc/cxxapi/group__Support.html +1 -1
  27. data/doc/cxxapi/main.html +1 -1
  28. data/doc/cxxapi/modules.html +1 -1
  29. data/doc/rdoc/classes/ConditionVariable.html +59 -59
  30. data/doc/rdoc/classes/Exception.html +11 -11
  31. data/doc/rdoc/classes/GC.html +4 -4
  32. data/doc/rdoc/classes/IO.html +14 -14
  33. data/doc/rdoc/classes/PhusionPassenger.html +13 -13
  34. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +8 -8
  35. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +26 -26
  36. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +98 -98
  37. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +61 -61
  38. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +8 -8
  39. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +32 -32
  40. data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
  41. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +12 -12
  42. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +4 -4
  43. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
  44. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +5 -5
  45. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +42 -42
  46. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +24 -24
  47. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +8 -8
  48. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +8 -8
  49. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +62 -66
  50. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +23 -23
  51. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +30 -30
  52. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +8 -8
  53. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +23 -23
  54. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +4 -4
  55. data/doc/rdoc/classes/PhusionPassenger/Utils.html +384 -384
  56. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +36 -36
  57. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +4 -4
  58. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +7 -7
  59. data/doc/rdoc/classes/PlatformInfo.html +234 -200
  60. data/doc/rdoc/classes/RakeExtensions.html +4 -4
  61. data/doc/rdoc/classes/Signal.html +27 -27
  62. data/doc/rdoc/created.rid +1 -1
  63. data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
  64. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  65. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +1 -1
  66. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +1 -1
  67. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +1 -1
  68. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
  69. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +1 -1
  70. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
  71. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +1 -1
  72. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +1 -1
  73. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
  74. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
  75. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +1 -1
  76. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -3
  77. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
  78. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +1 -1
  79. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +10 -9
  80. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +1 -1
  81. data/doc/rdoc/fr_method_index.html +148 -147
  82. data/ext/apache2/DirectoryMapper.h +6 -6
  83. data/ext/common/Utils.cpp +31 -5
  84. data/ext/common/Version.h +1 -1
  85. data/ext/nginx/Configuration.c +4 -8
  86. data/ext/nginx/Configuration.h +2 -2
  87. data/ext/nginx/ContentHandler.c +11 -7
  88. data/ext/oxt/thread.hpp +12 -11
  89. data/lib/phusion_passenger/constants.rb +1 -1
  90. data/lib/phusion_passenger/dependencies.rb +40 -25
  91. data/lib/phusion_passenger/platform_info.rb +28 -11
  92. data/lib/phusion_passenger/railz/application_spawner.rb +3 -7
  93. data/lib/phusion_passenger/templates/apache2/deployment_example.txt.erb +7 -4
  94. data/lib/phusion_passenger/utils.rb +1 -0
  95. data/test/integration_tests/apache2_tests.rb +16 -0
  96. data/test/integration_tests/nginx_tests.rb +46 -0
  97. data/test/stub/MessageServer.dSYM/Contents/Info.plist +25 -0
  98. data/test/stub/MessageServer.dSYM/Contents/Resources/DWARF/MessageServer +0 -0
  99. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  100. metadata +4 -2
@@ -95,9 +95,9 @@ href="ApplicationSpawner.html">ApplicationSpawner</a> internally.
95
95
  <p>
96
96
  <b>Note</b>: <a href="FrameworkSpawner.html">FrameworkSpawner</a> may only
97
97
  be started asynchronously with <a
98
- href="../AbstractServer.html#M000134">AbstractServer#start</a>. Starting it
98
+ href="../AbstractServer.html#M000120">AbstractServer#start</a>. Starting it
99
99
  synchronously with <a
100
- href="../AbstractServer.html#M000135">AbstractServer#start_synchronously</a>
100
+ href="../AbstractServer.html#M000121">AbstractServer#start_synchronously</a>
101
101
  has not been tested.
102
102
  </p>
103
103
  </div>
@@ -106,10 +106,10 @@ has not been tested.
106
106
 
107
107
  <div class="sectiontitle">Methods</div>
108
108
  <ul>
109
- <li><a href="#M000039">new</a></li>
110
- <li><a href="#M000042">reload</a></li>
111
- <li><a href="#M000041">spawn_application</a></li>
112
- <li><a href="#M000040">start</a></li>
109
+ <li><a href="#M000060">new</a></li>
110
+ <li><a href="#M000063">reload</a></li>
111
+ <li><a href="#M000062">spawn_application</a></li>
112
+ <li><a href="#M000061">start</a></li>
113
113
  </ul>
114
114
 
115
115
  <div class="sectiontitle">Included Modules</div>
@@ -127,11 +127,11 @@ has not been tested.
127
127
  <div class="sectiontitle">Public Class methods</div>
128
128
  <div class="method">
129
129
  <div class="title">
130
- <a name="M000039"></a><b>new</b>(options = {})
130
+ <a name="M000060"></a><b>new</b>(options = {})
131
131
  </div>
132
132
  <div class="description">
133
133
  <p>
134
- Creates a <a href="FrameworkSpawner.html#M000039">new</a> instance of <a
134
+ Creates a <a href="FrameworkSpawner.html#M000060">new</a> instance of <a
135
135
  href="FrameworkSpawner.html">FrameworkSpawner</a>.
136
136
  </p>
137
137
  <p>
@@ -163,15 +163,15 @@ href="RequestHandler.html">RequestHandler</a>.
163
163
  <p>
164
164
  Note that the specified Rails framework will be loaded during the entire
165
165
  life time of the <a href="FrameworkSpawner.html">FrameworkSpawner</a>
166
- server. If you wish to <a href="FrameworkSpawner.html#M000042">reload</a>
166
+ server. If you wish to <a href="FrameworkSpawner.html#M000063">reload</a>
167
167
  the Rails framework&#8216;s code, then restart the server by calling <a
168
- href="../AbstractServer.html#M000136">AbstractServer#stop</a> and <a
169
- href="../AbstractServer.html#M000134">AbstractServer#start</a>.
168
+ href="../AbstractServer.html#M000122">AbstractServer#stop</a> and <a
169
+ href="../AbstractServer.html#M000120">AbstractServer#start</a>.
170
170
  </p>
171
171
  </div>
172
172
  <div class="sourcecode">
173
- <p class="source-link">[ <a href="javascript:toggleSource('M000039_source')" id="l_M000039_source">show source</a> ]</p>
174
- <div id="M000039_source" class="dyn-source">
173
+ <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
174
+ <div id="M000060_source" class="dyn-source">
175
175
  <pre>
176
176
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 72</span>
177
177
  72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
@@ -203,7 +203,7 @@ href="../AbstractServer.html#M000134">AbstractServer#start</a>.
203
203
  <div class="sectiontitle">Public Instance methods</div>
204
204
  <div class="method">
205
205
  <div class="title">
206
- <a name="M000042"></a><b>reload</b>(app_root = nil)
206
+ <a name="M000063"></a><b>reload</b>(app_root = nil)
207
207
  </div>
208
208
  <div class="description">
209
209
  <p>
@@ -215,9 +215,9 @@ will be removed, no matter the application root.
215
215
  <b>Long description:</b> <a href="../Application.html">Application</a> code
216
216
  might be cached in memory by a <a
217
217
  href="FrameworkSpawner.html">FrameworkSpawner</a>. But once it a while, it
218
- will be necessary to <a href="FrameworkSpawner.html#M000042">reload</a> the
218
+ will be necessary to <a href="FrameworkSpawner.html#M000063">reload</a> the
219
219
  code for an application, such as after deploying a <a
220
- href="FrameworkSpawner.html#M000039">new</a> version of the application.
220
+ href="FrameworkSpawner.html#M000060">new</a> version of the application.
221
221
  This method makes sure that any cached application code is removed, so that
222
222
  the next time an application instance is spawned, the application code will
223
223
  be freshly loaded into memory.
@@ -238,8 +238,8 @@ unexpectedly.
238
238
  </ul>
239
239
  </div>
240
240
  <div class="sourcecode">
241
- <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
242
- <div id="M000042_source" class="dyn-source">
241
+ <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
242
+ <div id="M000063_source" class="dyn-source">
243
243
  <pre>
244
244
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 204</span>
245
245
  204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
@@ -257,7 +257,7 @@ unexpectedly.
257
257
  </div>
258
258
  <div class="method">
259
259
  <div class="title">
260
- <a name="M000041"></a><b>spawn_application</b>(app_root, options = {})
260
+ <a name="M000062"></a><b>spawn_application</b>(app_root, options = {})
261
261
  </div>
262
262
  <div class="description">
263
263
  <p>
@@ -268,8 +268,8 @@ will be returned, which represents the spawned RoR application.
268
268
  </p>
269
269
  <p>
270
270
  All options accepted by <a
271
- href="ApplicationSpawner.html#M000048">ApplicationSpawner.new</a> and <a
272
- href="RequestHandler.html#M000052">RequestHandler.new</a> are accepted.
271
+ href="ApplicationSpawner.html#M000069">ApplicationSpawner.new</a> and <a
272
+ href="RequestHandler.html#M000073">RequestHandler.new</a> are accepted.
273
273
  </p>
274
274
  <p>
275
275
  <a href="FrameworkSpawner.html">FrameworkSpawner</a> will internally cache
@@ -279,12 +279,12 @@ you must do one of these things:
279
279
  </p>
280
280
  <ul>
281
281
  <li>Restart this <a href="FrameworkSpawner.html">FrameworkSpawner</a> by
282
- calling <a href="../AbstractServer.html#M000136">AbstractServer#stop</a>,
283
- then <a href="../AbstractServer.html#M000134">AbstractServer#start</a>.
282
+ calling <a href="../AbstractServer.html#M000122">AbstractServer#stop</a>,
283
+ then <a href="../AbstractServer.html#M000120">AbstractServer#start</a>.
284
284
 
285
285
  </li>
286
286
  <li>Reload the application by calling <a
287
- href="FrameworkSpawner.html#M000042">reload</a> with the correct app_root
287
+ href="FrameworkSpawner.html#M000063">reload</a> with the correct app_root
288
288
  argument.
289
289
 
290
290
  </li>
@@ -320,8 +320,8 @@ unexpectedly.
320
320
  </ul>
321
321
  </div>
322
322
  <div class="sourcecode">
323
- <p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>
324
- <div id="M000041_source" class="dyn-source">
323
+ <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
324
+ <div id="M000062_source" class="dyn-source">
325
325
  <pre>
326
326
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 150</span>
327
327
  150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span> = {})
@@ -367,12 +367,12 @@ unexpectedly.
367
367
  </div>
368
368
  <div class="method">
369
369
  <div class="title">
370
- <a name="M000040"></a><b>start</b>()
370
+ <a name="M000061"></a><b>start</b>()
371
371
  </div>
372
372
  <div class="description">
373
373
  <p>
374
374
  Overrided from <a
375
- href="../AbstractServer.html#M000134">AbstractServer#start</a>.
375
+ href="../AbstractServer.html#M000120">AbstractServer#start</a>.
376
376
  </p>
377
377
  <p>
378
378
  May raise these additional exceptions:
@@ -390,8 +390,8 @@ unexpectedly.
390
390
  </ul>
391
391
  </div>
392
392
  <div class="sourcecode">
393
- <p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>
394
- <div id="M000040_source" class="dyn-source">
393
+ <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
394
+ <div id="M000061_source" class="dyn-source">
395
395
  <pre>
396
396
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 100</span>
397
397
  100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
@@ -84,8 +84,8 @@ A request handler for Ruby on Rails applications.
84
84
 
85
85
  <div class="sectiontitle">Methods</div>
86
86
  <ul>
87
- <li><a href="#M000052">new</a></li>
88
- <li><a href="#M000053">process_request</a></li>
87
+ <li><a href="#M000073">new</a></li>
88
+ <li><a href="#M000074">process_request</a></li>
89
89
  </ul>
90
90
 
91
91
 
@@ -104,11 +104,11 @@ A request handler for Ruby on Rails applications.
104
104
  <div class="sectiontitle">Public Class methods</div>
105
105
  <div class="method">
106
106
  <div class="title">
107
- <a name="M000052"></a><b>new</b>(owner_pipe, options = {})
107
+ <a name="M000073"></a><b>new</b>(owner_pipe, options = {})
108
108
  </div>
109
109
  <div class="sourcecode">
110
- <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
111
- <div id="M000052_source" class="dyn-source">
110
+ <p class="source-link">[ <a href="javascript:toggleSource('M000073_source')" id="l_M000073_source">show source</a> ]</p>
111
+ <div id="M000073_source" class="dyn-source">
112
112
  <pre>
113
113
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 38</span>
114
114
  38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span> = {})
@@ -124,7 +124,7 @@ A request handler for Ruby on Rails applications.
124
124
  <div class="sectiontitle">Protected Instance methods</div>
125
125
  <div class="method">
126
126
  <div class="title">
127
- <a name="M000053"></a><b>process_request</b>(headers, input, output)
127
+ <a name="M000074"></a><b>process_request</b>(headers, input, output)
128
128
  </div>
129
129
  <div class="description">
130
130
  <p>
@@ -132,8 +132,8 @@ Overrided method.
132
132
  </p>
133
133
  </div>
134
134
  <div class="sourcecode">
135
- <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
136
- <div id="M000053_source" class="dyn-source">
135
+ <p class="source-link">[ <a href="javascript:toggleSource('M000074_source')" id="l_M000074_source">show source</a> ]</p>
136
+ <div id="M000074_source" class="dyn-source">
137
137
  <pre>
138
138
  <span class="ruby-comment cmt"># File lib/phusion_passenger/railz/request_handler.rb, line 47</span>
139
139
  47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
@@ -85,9 +85,9 @@ fascade for the rest of the spawn manager system.
85
85
  <p>
86
86
  <b>Note</b>: <a href="SpawnManager.html">SpawnManager</a> may only be
87
87
  started synchronously with <a
88
- href="AbstractServer.html#M000135">AbstractServer#start_synchronously</a>.
88
+ href="AbstractServer.html#M000121">AbstractServer#start_synchronously</a>.
89
89
  Starting asynchronously has not been tested. Don&#8216;t forget to call <a
90
- href="SpawnManager.html#M000123">cleanup</a> after the server&#8216;s main
90
+ href="SpawnManager.html#M000153">cleanup</a> after the server&#8216;s main
91
91
  loop has finished.
92
92
  </p>
93
93
  <h2>Ruby on Rails optimizations</h2>
@@ -116,10 +116,10 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
116
116
 
117
117
  <div class="sectiontitle">Methods</div>
118
118
  <ul>
119
- <li><a href="#M000123">cleanup</a></li>
120
- <li><a href="#M000120">new</a></li>
121
- <li><a href="#M000122">reload</a></li>
122
- <li><a href="#M000121">spawn_application</a></li>
119
+ <li><a href="#M000153">cleanup</a></li>
120
+ <li><a href="#M000150">new</a></li>
121
+ <li><a href="#M000152">reload</a></li>
122
+ <li><a href="#M000151">spawn_application</a></li>
123
123
  </ul>
124
124
 
125
125
  <div class="sectiontitle">Included Modules</div>
@@ -134,11 +134,11 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
134
134
  <div class="sectiontitle">Public Class methods</div>
135
135
  <div class="method">
136
136
  <div class="title">
137
- <a name="M000120"></a><b>new</b>()
137
+ <a name="M000150"></a><b>new</b>()
138
138
  </div>
139
139
  <div class="sourcecode">
140
- <p class="source-link">[ <a href="javascript:toggleSource('M000120_source')" id="l_M000120_source">show source</a> ]</p>
141
- <div id="M000120_source" class="dyn-source">
140
+ <p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">show source</a> ]</p>
141
+ <div id="M000150_source" class="dyn-source">
142
142
  <pre>
143
143
  <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 61</span>
144
144
  61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
@@ -180,7 +180,7 @@ work around an obscure bug in ActiveSupport&#8216;s Dispatcher.
180
180
  <div class="sectiontitle">Public Instance methods</div>
181
181
  <div class="method">
182
182
  <div class="title">
183
- <a name="M000123"></a><b>cleanup</b>()
183
+ <a name="M000153"></a><b>cleanup</b>()
184
184
  </div>
185
185
  <div class="description">
186
186
  <p>
@@ -189,8 +189,8 @@ href="SpawnManager.html">SpawnManager</a> is no longer needed.
189
189
  </p>
190
190
  </div>
191
191
  <div class="sourcecode">
192
- <p class="source-link">[ <a href="javascript:toggleSource('M000123_source')" id="l_M000123_source">show source</a> ]</p>
193
- <div id="M000123_source" class="dyn-source">
192
+ <p class="source-link">[ <a href="javascript:toggleSource('M000153_source')" id="l_M000153_source">show source</a> ]</p>
193
+ <div id="M000153_source" class="dyn-source">
194
194
  <pre>
195
195
  <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 215</span>
196
196
  215: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
@@ -202,7 +202,7 @@ href="SpawnManager.html">SpawnManager</a> is no longer needed.
202
202
  </div>
203
203
  <div class="method">
204
204
  <div class="title">
205
- <a name="M000122"></a><b>reload</b>(app_root = nil)
205
+ <a name="M000152"></a><b>reload</b>(app_root = nil)
206
206
  </div>
207
207
  <div class="description">
208
208
  <p>
@@ -213,8 +213,8 @@ will be removed, no matter the application root.
213
213
  <p>
214
214
  <b>Long description:</b> <a href="Application.html">Application</a> code
215
215
  might be cached in memory. But once it a while, it will be necessary to <a
216
- href="SpawnManager.html#M000122">reload</a> the code for an application,
217
- such as after deploying a <a href="SpawnManager.html#M000120">new</a>
216
+ href="SpawnManager.html#M000152">reload</a> the code for an application,
217
+ such as after deploying a <a href="SpawnManager.html#M000150">new</a>
218
218
  version of the application. This method makes sure that any cached
219
219
  application code is removed, so that the next time an application instance
220
220
  is spawned, the application code will be freshly loaded into memory.
@@ -224,8 +224,8 @@ Raises AbstractServer::SpawnError if something went wrong.
224
224
  </p>
225
225
  </div>
226
226
  <div class="sourcecode">
227
- <p class="source-link">[ <a href="javascript:toggleSource('M000122_source')" id="l_M000122_source">show source</a> ]</p>
228
- <div id="M000122_source" class="dyn-source">
227
+ <p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">show source</a> ]</p>
228
+ <div id="M000152_source" class="dyn-source">
229
229
  <pre>
230
230
  <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 188</span>
231
231
  188: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
@@ -259,7 +259,7 @@ Raises AbstractServer::SpawnError if something went wrong.
259
259
  </div>
260
260
  <div class="method">
261
261
  <div class="title">
262
- <a name="M000121"></a><b>spawn_application</b>(options)
262
+ <a name="M000151"></a><b>spawn_application</b>(options)
263
263
  </div>
264
264
  <div class="description">
265
265
  <p>
@@ -288,12 +288,12 @@ must do one of these things:
288
288
 
289
289
  <ul>
290
290
  <li>Restart this <a href="SpawnManager.html">SpawnManager</a> by calling <a
291
- href="AbstractServer.html#M000136">AbstractServer#stop</a>, then <a
292
- href="AbstractServer.html#M000134">AbstractServer#start</a>.
291
+ href="AbstractServer.html#M000122">AbstractServer#stop</a>, then <a
292
+ href="AbstractServer.html#M000120">AbstractServer#start</a>.
293
293
 
294
294
  </li>
295
295
  <li>Reload the application by calling <a
296
- href="SpawnManager.html#M000122">reload</a> with the correct app_root
296
+ href="SpawnManager.html#M000152">reload</a> with the correct app_root
297
297
  argument.
298
298
 
299
299
  </li>
@@ -354,8 +354,8 @@ exception or called exit() during startup.
354
354
  </ul>
355
355
  </div>
356
356
  <div class="sourcecode">
357
- <p class="source-link">[ <a href="javascript:toggleSource('M000121_source')" id="l_M000121_source">show source</a> ]</p>
358
- <div id="M000121_source" class="dyn-source">
357
+ <p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">show source</a> ]</p>
358
+ <div id="M000151_source" class="dyn-source">
359
359
  <pre>
360
360
  <span class="ruby-comment cmt"># File lib/phusion_passenger/spawn_manager.rb, line 142</span>
361
361
  142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span>)
@@ -80,7 +80,7 @@ StandardError
80
80
 
81
81
  <div class="sectiontitle">Methods</div>
82
82
  <ul>
83
- <li><a href="#M000129">new</a></li>
83
+ <li><a href="#M000155">new</a></li>
84
84
  </ul>
85
85
 
86
86
 
@@ -101,11 +101,11 @@ StandardError
101
101
  <div class="sectiontitle">Public Class methods</div>
102
102
  <div class="method">
103
103
  <div class="title">
104
- <a name="M000129"></a><b>new</b>(message, class_name, backtrace)
104
+ <a name="M000155"></a><b>new</b>(message, class_name, backtrace)
105
105
  </div>
106
106
  <div class="sourcecode">
107
- <p class="source-link">[ <a href="javascript:toggleSource('M000129_source')" id="l_M000129_source">show source</a> ]</p>
108
- <div id="M000129_source" class="dyn-source">
107
+ <p class="source-link">[ <a href="javascript:toggleSource('M000155_source')" id="l_M000155_source">show source</a> ]</p>
108
+ <div id="M000155_source" class="dyn-source">
109
109
  <pre>
110
110
  <span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 93</span>
111
111
  93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">backtrace</span>)
@@ -78,26 +78,26 @@ Utility functions.
78
78
 
79
79
  <div class="sectiontitle">Methods</div>
80
80
  <ul>
81
- <li><a href="#M000075">assert_valid_app_root</a></li>
82
- <li><a href="#M000076">assert_valid_directory</a></li>
83
- <li><a href="#M000077">assert_valid_file</a></li>
84
- <li><a href="#M000079">assert_valid_groupname</a></li>
85
- <li><a href="#M000078">assert_valid_username</a></li>
86
- <li><a href="#M000074">canonicalize_path</a></li>
87
- <li><a href="#M000080">close_all_io_objects_for_fds</a></li>
88
- <li><a href="#M000087">lower_privilege</a></li>
89
- <li><a href="#M000081">marshal_exception</a></li>
90
- <li><a href="#M000091">passenger_tmpdir</a></li>
81
+ <li><a href="#M000076">assert_valid_app_root</a></li>
82
+ <li><a href="#M000077">assert_valid_directory</a></li>
83
+ <li><a href="#M000078">assert_valid_file</a></li>
84
+ <li><a href="#M000080">assert_valid_groupname</a></li>
85
+ <li><a href="#M000079">assert_valid_username</a></li>
86
+ <li><a href="#M000075">canonicalize_path</a></li>
87
+ <li><a href="#M000081">close_all_io_objects_for_fds</a></li>
88
+ <li><a href="#M000088">lower_privilege</a></li>
89
+ <li><a href="#M000082">marshal_exception</a></li>
91
90
  <li><a href="#M000092">passenger_tmpdir</a></li>
92
- <li><a href="#M000093">passenger_tmpdir=</a></li>
93
- <li><a href="#M000083">print_exception</a></li>
94
- <li><a href="#M000085">report_app_init_status</a></li>
95
- <li><a href="#M000084">safe_fork</a></li>
96
- <li><a href="#M000090">sanitize_spawn_options</a></li>
97
- <li><a href="#M000088">switch_to_user</a></li>
98
- <li><a href="#M000089">to_boolean</a></li>
99
- <li><a href="#M000086">unmarshal_and_raise_errors</a></li>
100
- <li><a href="#M000082">unmarshal_exception</a></li>
91
+ <li><a href="#M000093">passenger_tmpdir</a></li>
92
+ <li><a href="#M000094">passenger_tmpdir=</a></li>
93
+ <li><a href="#M000084">print_exception</a></li>
94
+ <li><a href="#M000086">report_app_init_status</a></li>
95
+ <li><a href="#M000085">safe_fork</a></li>
96
+ <li><a href="#M000091">sanitize_spawn_options</a></li>
97
+ <li><a href="#M000089">switch_to_user</a></li>
98
+ <li><a href="#M000090">to_boolean</a></li>
99
+ <li><a href="#M000087">unmarshal_and_raise_errors</a></li>
100
+ <li><a href="#M000083">unmarshal_exception</a></li>
101
101
  </ul>
102
102
 
103
103
 
@@ -111,7 +111,7 @@ Utility functions.
111
111
  <div class="sectiontitle">Protected Class methods</div>
112
112
  <div class="method">
113
113
  <div class="title">
114
- <a name="M000092"></a><b>passenger_tmpdir</b>(create = true)
114
+ <a name="M000093"></a><b>passenger_tmpdir</b>(create = true)
115
115
  </div>
116
116
  <div class="description">
117
117
  <p>
@@ -121,43 +121,43 @@ directory if it doesn&#8216;t exist.
121
121
  </p>
122
122
  </div>
123
123
  <div class="sourcecode">
124
- <p class="source-link">[ <a href="javascript:toggleSource('M000092_source')" id="l_M000092_source">show source</a> ]</p>
125
- <div id="M000092_source" class="dyn-source">
124
+ <p class="source-link">[ <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show source</a> ]</p>
125
+ <div id="M000093_source" class="dyn-source">
126
126
  <pre>
127
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 420</span>
128
- 420: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
129
- 421: <span class="ruby-identifier">dir</span> = <span class="ruby-ivar">@@passenger_tmpdir</span>
130
- 422: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">empty?</span>
131
- 423: <span class="ruby-identifier">dir</span> = <span class="ruby-node">&quot;#{Dir.tmpdir}/passenger.#{Process.pid}&quot;</span>
132
- 424: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
133
- 425: <span class="ruby-keyword kw">end</span>
134
- 426: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">create</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">dir</span>)
135
- 427: <span class="ruby-comment cmt"># This is a very minimal implementation of the function</span>
136
- 428: <span class="ruby-comment cmt"># passengerCreateTempDir() in Utils.cpp. This implementation</span>
137
- 429: <span class="ruby-comment cmt"># is only meant to make the unit tests pass. For production</span>
138
- 430: <span class="ruby-comment cmt"># systems one should pre-create the temp directory with</span>
139
- 431: <span class="ruby-comment cmt"># passengerCreateTempDir().</span>
140
- 432: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-identifier">dir</span>)
141
- 433: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-node">&quot;#{dir}/backends&quot;</span>)
142
- 434: <span class="ruby-keyword kw">end</span>
143
- 435: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dir</span>
144
- 436: <span class="ruby-keyword kw">end</span>
127
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 421</span>
128
+ 421: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
129
+ 422: <span class="ruby-identifier">dir</span> = <span class="ruby-ivar">@@passenger_tmpdir</span>
130
+ 423: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">empty?</span>
131
+ 424: <span class="ruby-identifier">dir</span> = <span class="ruby-node">&quot;#{Dir.tmpdir}/passenger.#{Process.pid}&quot;</span>
132
+ 425: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
133
+ 426: <span class="ruby-keyword kw">end</span>
134
+ 427: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">create</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">dir</span>)
135
+ 428: <span class="ruby-comment cmt"># This is a very minimal implementation of the function</span>
136
+ 429: <span class="ruby-comment cmt"># passengerCreateTempDir() in Utils.cpp. This implementation</span>
137
+ 430: <span class="ruby-comment cmt"># is only meant to make the unit tests pass. For production</span>
138
+ 431: <span class="ruby-comment cmt"># systems one should pre-create the temp directory with</span>
139
+ 432: <span class="ruby-comment cmt"># passengerCreateTempDir().</span>
140
+ 433: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-identifier">dir</span>)
141
+ 434: <span class="ruby-identifier">system</span>(<span class="ruby-value str">&quot;mkdir&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;-m&quot;</span>, <span class="ruby-value str">&quot;u=wxs,g=wx,o=wx&quot;</span>, <span class="ruby-node">&quot;#{dir}/backends&quot;</span>)
142
+ 435: <span class="ruby-keyword kw">end</span>
143
+ 436: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dir</span>
144
+ 437: <span class="ruby-keyword kw">end</span>
145
145
  </pre>
146
146
  </div>
147
147
  </div>
148
148
  </div>
149
149
  <div class="method">
150
150
  <div class="title">
151
- <a name="M000093"></a><b>passenger_tmpdir=</b>(dir)
151
+ <a name="M000094"></a><b>passenger_tmpdir=</b>(dir)
152
152
  </div>
153
153
  <div class="sourcecode">
154
- <p class="source-link">[ <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show source</a> ]</p>
155
- <div id="M000093_source" class="dyn-source">
154
+ <p class="source-link">[ <a href="javascript:toggleSource('M000094_source')" id="l_M000094_source">show source</a> ]</p>
155
+ <div id="M000094_source" class="dyn-source">
156
156
  <pre>
157
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 438</span>
158
- 438: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir=</span>(<span class="ruby-identifier">dir</span>)
159
- 439: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
160
- 440: <span class="ruby-keyword kw">end</span>
157
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 439</span>
158
+ 439: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_tmpdir=</span>(<span class="ruby-identifier">dir</span>)
159
+ 440: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
160
+ 441: <span class="ruby-keyword kw">end</span>
161
161
  </pre>
162
162
  </div>
163
163
  </div>
@@ -165,7 +165,7 @@ directory if it doesn&#8216;t exist.
165
165
  <div class="sectiontitle">Protected Instance methods</div>
166
166
  <div class="method">
167
167
  <div class="title">
168
- <a name="M000075"></a><b>assert_valid_app_root</b>(app_root)
168
+ <a name="M000076"></a><b>assert_valid_app_root</b>(app_root)
169
169
  </div>
170
170
  <div class="description">
171
171
  <p>
@@ -174,21 +174,21 @@ Raises <a href="InvalidPath.html">InvalidPath</a> if that is not the case.
174
174
  </p>
175
175
  </div>
176
176
  <div class="sourcecode">
177
- <p class="source-link">[ <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show source</a> ]</p>
178
- <div id="M000075_source" class="dyn-source">
177
+ <p class="source-link">[ <a href="javascript:toggleSource('M000076_source')" id="l_M000076_source">show source</a> ]</p>
178
+ <div id="M000076_source" class="dyn-source">
179
179
  <pre>
180
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 60</span>
181
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_app_root</span>(<span class="ruby-identifier">app_root</span>)
182
- 61: <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">app_root</span>)
183
- 62: <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-node">&quot;#{app_root}/config/environment.rb&quot;</span>)
184
- 63: <span class="ruby-keyword kw">end</span>
180
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 61</span>
181
+ 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_app_root</span>(<span class="ruby-identifier">app_root</span>)
182
+ 62: <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">app_root</span>)
183
+ 63: <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-node">&quot;#{app_root}/config/environment.rb&quot;</span>)
184
+ 64: <span class="ruby-keyword kw">end</span>
185
185
  </pre>
186
186
  </div>
187
187
  </div>
188
188
  </div>
189
189
  <div class="method">
190
190
  <div class="title">
191
- <a name="M000076"></a><b>assert_valid_directory</b>(path)
191
+ <a name="M000077"></a><b>assert_valid_directory</b>(path)
192
192
  </div>
193
193
  <div class="description">
194
194
  <p>
@@ -197,22 +197,22 @@ href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
197
197
  </p>
198
198
  </div>
199
199
  <div class="sourcecode">
200
- <p class="source-link">[ <a href="javascript:toggleSource('M000076_source')" id="l_M000076_source">show source</a> ]</p>
201
- <div id="M000076_source" class="dyn-source">
200
+ <p class="source-link">[ <a href="javascript:toggleSource('M000077_source')" id="l_M000077_source">show source</a> ]</p>
201
+ <div id="M000077_source" class="dyn-source">
202
202
  <pre>
203
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 66</span>
204
- 66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">path</span>)
205
- 67: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
206
- 68: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid directory.&quot;</span>
207
- 69: <span class="ruby-keyword kw">end</span>
208
- 70: <span class="ruby-keyword kw">end</span>
203
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 67</span>
204
+ 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">path</span>)
205
+ 68: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
206
+ 69: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid directory.&quot;</span>
207
+ 70: <span class="ruby-keyword kw">end</span>
208
+ 71: <span class="ruby-keyword kw">end</span>
209
209
  </pre>
210
210
  </div>
211
211
  </div>
212
212
  </div>
213
213
  <div class="method">
214
214
  <div class="title">
215
- <a name="M000077"></a><b>assert_valid_file</b>(path)
215
+ <a name="M000078"></a><b>assert_valid_file</b>(path)
216
216
  </div>
217
217
  <div class="description">
218
218
  <p>
@@ -221,22 +221,22 @@ href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
221
221
  </p>
222
222
  </div>
223
223
  <div class="sourcecode">
224
- <p class="source-link">[ <a href="javascript:toggleSource('M000077_source')" id="l_M000077_source">show source</a> ]</p>
225
- <div id="M000077_source" class="dyn-source">
224
+ <p class="source-link">[ <a href="javascript:toggleSource('M000078_source')" id="l_M000078_source">show source</a> ]</p>
225
+ <div id="M000078_source" class="dyn-source">
226
226
  <pre>
227
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 73</span>
228
- 73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-identifier">path</span>)
229
- 74: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">path</span>)
230
- 75: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid file.&quot;</span>
231
- 76: <span class="ruby-keyword kw">end</span>
232
- 77: <span class="ruby-keyword kw">end</span>
227
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 74</span>
228
+ 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-identifier">path</span>)
229
+ 75: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">path</span>)
230
+ 76: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-node">&quot;'#{path}' is not a valid file.&quot;</span>
231
+ 77: <span class="ruby-keyword kw">end</span>
232
+ 78: <span class="ruby-keyword kw">end</span>
233
233
  </pre>
234
234
  </div>
235
235
  </div>
236
236
  </div>
237
237
  <div class="method">
238
238
  <div class="title">
239
- <a name="M000079"></a><b>assert_valid_groupname</b>(groupname)
239
+ <a name="M000080"></a><b>assert_valid_groupname</b>(groupname)
240
240
  </div>
241
241
  <div class="description">
242
242
  <p>
@@ -245,21 +245,21 @@ if that is not the case.
245
245
  </p>
246
246
  </div>
247
247
  <div class="sourcecode">
248
- <p class="source-link">[ <a href="javascript:toggleSource('M000079_source')" id="l_M000079_source">show source</a> ]</p>
249
- <div id="M000079_source" class="dyn-source">
248
+ <p class="source-link">[ <a href="javascript:toggleSource('M000080_source')" id="l_M000080_source">show source</a> ]</p>
249
+ <div id="M000080_source" class="dyn-source">
250
250
  <pre>
251
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 88</span>
252
- 88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_groupname</span>(<span class="ruby-identifier">groupname</span>)
253
- 89: <span class="ruby-comment cmt"># If groupname does not exist then getgrnam() will raise an ArgumentError.</span>
254
- 90: <span class="ruby-identifier">groupname</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrnam</span>(<span class="ruby-identifier">groupname</span>)
255
- 91: <span class="ruby-keyword kw">end</span>
251
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 89</span>
252
+ 89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_groupname</span>(<span class="ruby-identifier">groupname</span>)
253
+ 90: <span class="ruby-comment cmt"># If groupname does not exist then getgrnam() will raise an ArgumentError.</span>
254
+ 91: <span class="ruby-identifier">groupname</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrnam</span>(<span class="ruby-identifier">groupname</span>)
255
+ 92: <span class="ruby-keyword kw">end</span>
256
256
  </pre>
257
257
  </div>
258
258
  </div>
259
259
  </div>
260
260
  <div class="method">
261
261
  <div class="title">
262
- <a name="M000078"></a><b>assert_valid_username</b>(username)
262
+ <a name="M000079"></a><b>assert_valid_username</b>(username)
263
263
  </div>
264
264
  <div class="description">
265
265
  <p>
@@ -268,21 +268,21 @@ that is not the case.
268
268
  </p>
269
269
  </div>
270
270
  <div class="sourcecode">
271
- <p class="source-link">[ <a href="javascript:toggleSource('M000078_source')" id="l_M000078_source">show source</a> ]</p>
272
- <div id="M000078_source" class="dyn-source">
271
+ <p class="source-link">[ <a href="javascript:toggleSource('M000079_source')" id="l_M000079_source">show source</a> ]</p>
272
+ <div id="M000079_source" class="dyn-source">
273
273
  <pre>
274
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 81</span>
275
- 81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_username</span>(<span class="ruby-identifier">username</span>)
276
- 82: <span class="ruby-comment cmt"># If username does not exist then getpwnam() will raise an ArgumentError.</span>
277
- 83: <span class="ruby-identifier">username</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">username</span>)
278
- 84: <span class="ruby-keyword kw">end</span>
274
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 82</span>
275
+ 82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_username</span>(<span class="ruby-identifier">username</span>)
276
+ 83: <span class="ruby-comment cmt"># If username does not exist then getpwnam() will raise an ArgumentError.</span>
277
+ 84: <span class="ruby-identifier">username</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">username</span>)
278
+ 85: <span class="ruby-keyword kw">end</span>
279
279
  </pre>
280
280
  </div>
281
281
  </div>
282
282
  </div>
283
283
  <div class="method">
284
284
  <div class="title">
285
- <a name="M000074"></a><b>canonicalize_path</b>(path)
285
+ <a name="M000075"></a><b>canonicalize_path</b>(path)
286
286
  </div>
287
287
  <div class="description">
288
288
  <p>
@@ -297,46 +297,46 @@ Raises SystemCallError if something went wrong. Raises ArgumentError if
297
297
  </p>
298
298
  </div>
299
299
  <div class="sourcecode">
300
- <p class="source-link">[ <a href="javascript:toggleSource('M000074_source')" id="l_M000074_source">show source</a> ]</p>
301
- <div id="M000074_source" class="dyn-source">
300
+ <p class="source-link">[ <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show source</a> ]</p>
301
+ <div id="M000075_source" class="dyn-source">
302
302
  <pre>
303
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 51</span>
304
- 51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-identifier">path</span>)
305
- 52: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'path' argument may not be nil&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span>
306
- 53: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">realpath</span>.<span class="ruby-identifier">to_s</span>
307
- 54: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
308
- 55: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidAPath</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
309
- 56: <span class="ruby-keyword kw">end</span>
303
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 52</span>
304
+ 52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-identifier">path</span>)
305
+ 53: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;The 'path' argument may not be nil&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span>
306
+ 54: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">realpath</span>.<span class="ruby-identifier">to_s</span>
307
+ 55: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
308
+ 56: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidAPath</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
309
+ 57: <span class="ruby-keyword kw">end</span>
310
310
  </pre>
311
311
  </div>
312
312
  </div>
313
313
  </div>
314
314
  <div class="method">
315
315
  <div class="title">
316
- <a name="M000080"></a><b>close_all_io_objects_for_fds</b>(file_descriptors_to_leave_open)
316
+ <a name="M000081"></a><b>close_all_io_objects_for_fds</b>(file_descriptors_to_leave_open)
317
317
  </div>
318
318
  <div class="sourcecode">
319
- <p class="source-link">[ <a href="javascript:toggleSource('M000080_source')" id="l_M000080_source">show source</a> ]</p>
320
- <div id="M000080_source" class="dyn-source">
319
+ <p class="source-link">[ <a href="javascript:toggleSource('M000081_source')" id="l_M000081_source">show source</a> ]</p>
320
+ <div id="M000081_source" class="dyn-source">
321
321
  <pre>
322
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 93</span>
323
- 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
324
- 94: <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">each_object</span>(<span class="ruby-constant">IO</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
325
- 95: <span class="ruby-keyword kw">begin</span>
326
- 96: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">file_descriptors_to_leave_open</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">io</span>.<span class="ruby-identifier">fileno</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">io</span>.<span class="ruby-identifier">closed?</span>
327
- 97: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>
328
- 98: <span class="ruby-keyword kw">end</span>
329
- 99: <span class="ruby-keyword kw">rescue</span>
330
- 100: <span class="ruby-keyword kw">end</span>
331
- 101: <span class="ruby-keyword kw">end</span>
332
- 102: <span class="ruby-keyword kw">end</span>
322
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 94</span>
323
+ 94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
324
+ 95: <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">each_object</span>(<span class="ruby-constant">IO</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
325
+ 96: <span class="ruby-keyword kw">begin</span>
326
+ 97: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">file_descriptors_to_leave_open</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">io</span>.<span class="ruby-identifier">fileno</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">io</span>.<span class="ruby-identifier">closed?</span>
327
+ 98: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>
328
+ 99: <span class="ruby-keyword kw">end</span>
329
+ 100: <span class="ruby-keyword kw">rescue</span>
330
+ 101: <span class="ruby-keyword kw">end</span>
331
+ 102: <span class="ruby-keyword kw">end</span>
332
+ 103: <span class="ruby-keyword kw">end</span>
333
333
  </pre>
334
334
  </div>
335
335
  </div>
336
336
  </div>
337
337
  <div class="method">
338
338
  <div class="title">
339
- <a name="M000087"></a><b>lower_privilege</b>(filename, lowest_user = &quot;nobody&quot;)
339
+ <a name="M000088"></a><b>lower_privilege</b>(filename, lowest_user = &quot;nobody&quot;)
340
340
  </div>
341
341
  <div class="description">
342
342
  <p>
@@ -345,78 +345,78 @@ No exceptions will be raised in the event that privilege lowering fails.
345
345
  </p>
346
346
  </div>
347
347
  <div class="sourcecode">
348
- <p class="source-link">[ <a href="javascript:toggleSource('M000087_source')" id="l_M000087_source">show source</a> ]</p>
349
- <div id="M000087_source" class="dyn-source">
348
+ <p class="source-link">[ <a href="javascript:toggleSource('M000088_source')" id="l_M000088_source">show source</a> ]</p>
349
+ <div id="M000088_source" class="dyn-source">
350
350
  <pre>
351
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 343</span>
352
- 343: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lower_privilege</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">lowest_user</span> = <span class="ruby-value str">&quot;nobody&quot;</span>)
353
- 344: <span class="ruby-identifier">stat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">lstat</span>(<span class="ruby-identifier">filename</span>)
354
- 345: <span class="ruby-keyword kw">begin</span>
355
- 346: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">uid</span>)
356
- 347: <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">lowest_user</span>)
357
- 348: <span class="ruby-keyword kw">end</span>
358
- 349: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPERM</span>
359
- 350: <span class="ruby-comment cmt"># No problem if we were unable to switch user.</span>
360
- 351: <span class="ruby-keyword kw">end</span>
361
- 352: <span class="ruby-keyword kw">end</span>
351
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 344</span>
352
+ 344: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lower_privilege</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">lowest_user</span> = <span class="ruby-value str">&quot;nobody&quot;</span>)
353
+ 345: <span class="ruby-identifier">stat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">lstat</span>(<span class="ruby-identifier">filename</span>)
354
+ 346: <span class="ruby-keyword kw">begin</span>
355
+ 347: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">uid</span>)
356
+ 348: <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">lowest_user</span>)
357
+ 349: <span class="ruby-keyword kw">end</span>
358
+ 350: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPERM</span>
359
+ 351: <span class="ruby-comment cmt"># No problem if we were unable to switch user.</span>
360
+ 352: <span class="ruby-keyword kw">end</span>
361
+ 353: <span class="ruby-keyword kw">end</span>
362
362
  </pre>
363
363
  </div>
364
364
  </div>
365
365
  </div>
366
366
  <div class="method">
367
367
  <div class="title">
368
- <a name="M000081"></a><b>marshal_exception</b>(exception)
368
+ <a name="M000082"></a><b>marshal_exception</b>(exception)
369
369
  </div>
370
370
  <div class="sourcecode">
371
- <p class="source-link">[ <a href="javascript:toggleSource('M000081_source')" id="l_M000081_source">show source</a> ]</p>
372
- <div id="M000081_source" class="dyn-source">
371
+ <p class="source-link">[ <a href="javascript:toggleSource('M000082_source')" id="l_M000082_source">show source</a> ]</p>
372
+ <div id="M000082_source" class="dyn-source">
373
373
  <pre>
374
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 104</span>
375
- 104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>)
376
- 105: <span class="ruby-identifier">data</span> = {
377
- 106: <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>,
378
- 107: <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
379
- 108: <span class="ruby-identifier">:backtrace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>
380
- 109: }
381
- 110: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">InitializationError</span>)
382
- 111: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:is_initialization_error</span>] = <span class="ruby-keyword kw">true</span>
383
- 112: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>
384
- 113: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:child_exception</span>] = <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>)
385
- 114: <span class="ruby-keyword kw">end</span>
386
- 115: <span class="ruby-keyword kw">else</span>
387
- 116: <span class="ruby-keyword kw">begin</span>
388
- 117: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">exception</span>)
389
- 118: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
390
- 119: <span class="ruby-identifier">e</span> = <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
391
- 120: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>)
392
- 121: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">e</span>)
393
- 122: <span class="ruby-keyword kw">end</span>
394
- 123: <span class="ruby-keyword kw">end</span>
395
- 124: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">data</span>)
396
- 125: <span class="ruby-keyword kw">end</span>
374
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 105</span>
375
+ 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>)
376
+ 106: <span class="ruby-identifier">data</span> = {
377
+ 107: <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>,
378
+ 108: <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
379
+ 109: <span class="ruby-identifier">:backtrace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>
380
+ 110: }
381
+ 111: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">InitializationError</span>)
382
+ 112: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:is_initialization_error</span>] = <span class="ruby-keyword kw">true</span>
383
+ 113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>
384
+ 114: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:child_exception</span>] = <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>)
385
+ 115: <span class="ruby-keyword kw">end</span>
386
+ 116: <span class="ruby-keyword kw">else</span>
387
+ 117: <span class="ruby-keyword kw">begin</span>
388
+ 118: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">exception</span>)
389
+ 119: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
390
+ 120: <span class="ruby-identifier">e</span> = <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>,
391
+ 121: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>)
392
+ 122: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:exception</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">e</span>)
393
+ 123: <span class="ruby-keyword kw">end</span>
394
+ 124: <span class="ruby-keyword kw">end</span>
395
+ 125: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">data</span>)
396
+ 126: <span class="ruby-keyword kw">end</span>
397
397
  </pre>
398
398
  </div>
399
399
  </div>
400
400
  </div>
401
401
  <div class="method">
402
402
  <div class="title">
403
- <a name="M000091"></a><b>passenger_tmpdir</b>(create = true)
403
+ <a name="M000092"></a><b>passenger_tmpdir</b>(create = true)
404
404
  </div>
405
405
  <div class="sourcecode">
406
- <p class="source-link">[ <a href="javascript:toggleSource('M000091_source')" id="l_M000091_source">show source</a> ]</p>
407
- <div id="M000091_source" class="dyn-source">
406
+ <p class="source-link">[ <a href="javascript:toggleSource('M000092_source')" id="l_M000092_source">show source</a> ]</p>
407
+ <div id="M000092_source" class="dyn-source">
408
408
  <pre>
409
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 413</span>
410
- 413: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
411
- 414: <span class="ruby-constant">PhusionPassenger</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span>)
412
- 415: <span class="ruby-keyword kw">end</span>
409
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 414</span>
410
+ 414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span> = <span class="ruby-keyword kw">true</span>)
411
+ 415: <span class="ruby-constant">PhusionPassenger</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span>.<span class="ruby-identifier">passenger_tmpdir</span>(<span class="ruby-identifier">create</span>)
412
+ 416: <span class="ruby-keyword kw">end</span>
413
413
  </pre>
414
414
  </div>
415
415
  </div>
416
416
  </div>
417
417
  <div class="method">
418
418
  <div class="title">
419
- <a name="M000083"></a><b>print_exception</b>(current_location, exception, destination = STDERR)
419
+ <a name="M000084"></a><b>print_exception</b>(current_location, exception, destination = STDERR)
420
420
  </div>
421
421
  <div class="description">
422
422
  <p>
@@ -428,23 +428,23 @@ currently at. Usually the current class name will be enough.
428
428
  </p>
429
429
  </div>
430
430
  <div class="sourcecode">
431
- <p class="source-link">[ <a href="javascript:toggleSource('M000083_source')" id="l_M000083_source">show source</a> ]</p>
432
- <div id="M000083_source" class="dyn-source">
431
+ <p class="source-link">[ <a href="javascript:toggleSource('M000084_source')" id="l_M000084_source">show source</a> ]</p>
432
+ <div id="M000084_source" class="dyn-source">
433
433
  <pre>
434
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 158</span>
435
- 158: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>, <span class="ruby-identifier">exception</span>, <span class="ruby-identifier">destination</span> = <span class="ruby-constant">STDERR</span>)
436
- 159: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">SystemExit</span>)
437
- 160: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace_string</span>(<span class="ruby-identifier">current_location</span>))
438
- 161: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">flush</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:flush</span>)
439
- 162: <span class="ruby-keyword kw">end</span>
440
- 163: <span class="ruby-keyword kw">end</span>
434
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 159</span>
435
+ 159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>, <span class="ruby-identifier">exception</span>, <span class="ruby-identifier">destination</span> = <span class="ruby-constant">STDERR</span>)
436
+ 160: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">exception</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">SystemExit</span>)
437
+ 161: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace_string</span>(<span class="ruby-identifier">current_location</span>))
438
+ 162: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">flush</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:flush</span>)
439
+ 163: <span class="ruby-keyword kw">end</span>
440
+ 164: <span class="ruby-keyword kw">end</span>
441
441
  </pre>
442
442
  </div>
443
443
  </div>
444
444
  </div>
445
445
  <div class="method">
446
446
  <div class="title">
447
- <a name="M000085"></a><b>report_app_init_status</b>(channel, sink = STDERR) {|| ...}
447
+ <a name="M000086"></a><b>report_app_init_status</b>(channel, sink = STDERR) {|| ...}
448
448
  </div>
449
449
  <div class="description">
450
450
  <p>
@@ -470,54 +470,54 @@ that are propagated, only SystemExit will be reported.
470
470
  </p>
471
471
  </div>
472
472
  <div class="sourcecode">
473
- <p class="source-link">[ <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show source</a> ]</p>
474
- <div id="M000085_source" class="dyn-source">
473
+ <p class="source-link">[ <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show source</a> ]</p>
474
+ <div id="M000086_source" class="dyn-source">
475
475
  <pre>
476
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 242</span>
477
- 242: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">report_app_init_status</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">sink</span> = <span class="ruby-constant">STDERR</span>)
478
- 243: <span class="ruby-keyword kw">begin</span>
479
- 244: <span class="ruby-identifier">old_global_stderr</span> = <span class="ruby-identifier">$stderr</span>
480
- 245: <span class="ruby-identifier">old_stderr</span> = <span class="ruby-constant">STDERR</span>
481
- 246: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-value str">&quot;&quot;</span>
482
- 247:
483
- 248: <span class="ruby-identifier">pseudo_stderr</span> = <span class="ruby-constant">PseudoIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sink</span>)
484
- 249: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
485
- 250: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">pseudo_stderr</span>)
486
- 251: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">pseudo_stderr</span>
487
- 252:
488
- 253: <span class="ruby-keyword kw">begin</span>
489
- 254: <span class="ruby-keyword kw">yield</span>
490
- 255: <span class="ruby-keyword kw">ensure</span>
491
- 256: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
492
- 257: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">old_stderr</span>)
493
- 258: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">old_global_stderr</span>
494
- 259: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-identifier">pseudo_stderr</span>.<span class="ruby-identifier">done!</span>
495
- 260: <span class="ruby-keyword kw">end</span>
496
- 261:
497
- 262: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'success'</span>)
498
- 263: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
499
- 264: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>, <span class="ruby-constant">NoMemoryError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
500
- 265: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TESTING_PASSENGER'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'1'</span>
501
- 266: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
502
- 267: <span class="ruby-keyword kw">end</span>
503
- 268: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exception'</span>)
504
- 269: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
505
- 270: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
506
- 271: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
507
- 272: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
508
- 273: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exit'</span>)
509
- 274: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
510
- 275: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
511
- 276: <span class="ruby-identifier">raise</span>
512
- 277: <span class="ruby-keyword kw">end</span>
513
- 278: <span class="ruby-keyword kw">end</span>
476
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 243</span>
477
+ 243: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">report_app_init_status</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">sink</span> = <span class="ruby-constant">STDERR</span>)
478
+ 244: <span class="ruby-keyword kw">begin</span>
479
+ 245: <span class="ruby-identifier">old_global_stderr</span> = <span class="ruby-identifier">$stderr</span>
480
+ 246: <span class="ruby-identifier">old_stderr</span> = <span class="ruby-constant">STDERR</span>
481
+ 247: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-value str">&quot;&quot;</span>
482
+ 248:
483
+ 249: <span class="ruby-identifier">pseudo_stderr</span> = <span class="ruby-constant">PseudoIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sink</span>)
484
+ 250: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
485
+ 251: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">pseudo_stderr</span>)
486
+ 252: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">pseudo_stderr</span>
487
+ 253:
488
+ 254: <span class="ruby-keyword kw">begin</span>
489
+ 255: <span class="ruby-keyword kw">yield</span>
490
+ 256: <span class="ruby-keyword kw">ensure</span>
491
+ 257: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:remove_const</span>, <span class="ruby-value str">'STDERR'</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
492
+ 258: <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-value str">'STDERR'</span>, <span class="ruby-identifier">old_stderr</span>)
493
+ 259: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">old_global_stderr</span>
494
+ 260: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-identifier">pseudo_stderr</span>.<span class="ruby-identifier">done!</span>
495
+ 261: <span class="ruby-keyword kw">end</span>
496
+ 262:
497
+ 263: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'success'</span>)
498
+ 264: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
499
+ 265: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span>, <span class="ruby-constant">ScriptError</span>, <span class="ruby-constant">NoMemoryError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
500
+ 266: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TESTING_PASSENGER'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'1'</span>
501
+ 267: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
502
+ 268: <span class="ruby-keyword kw">end</span>
503
+ 269: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exception'</span>)
504
+ 270: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
505
+ 271: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
506
+ 272: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
507
+ 273: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
508
+ 274: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exit'</span>)
509
+ 275: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">e</span>))
510
+ 276: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
511
+ 277: <span class="ruby-identifier">raise</span>
512
+ 278: <span class="ruby-keyword kw">end</span>
513
+ 279: <span class="ruby-keyword kw">end</span>
514
514
  </pre>
515
515
  </div>
516
516
  </div>
517
517
  </div>
518
518
  <div class="method">
519
519
  <div class="title">
520
- <a name="M000084"></a><b>safe_fork</b>(current_location = self.class, double_fork = false) {|| ...}
520
+ <a name="M000085"></a><b>safe_fork</b>(current_location = self.class, double_fork = false) {|| ...}
521
521
  </div>
522
522
  <div class="description">
523
523
  <p>
@@ -536,151 +536,151 @@ the expense of not being able to waitpid() the second child.
536
536
  </p>
537
537
  </div>
538
538
  <div class="sourcecode">
539
- <p class="source-link">[ <a href="javascript:toggleSource('M000084_source')" id="l_M000084_source">show source</a> ]</p>
540
- <div id="M000084_source" class="dyn-source">
539
+ <p class="source-link">[ <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show source</a> ]</p>
540
+ <div id="M000085_source" class="dyn-source">
541
541
  <pre>
542
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 175</span>
543
- 175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">safe_fork</span>(<span class="ruby-identifier">current_location</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">double_fork</span> = <span class="ruby-keyword kw">false</span>)
544
- 176: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">fork</span>
545
- 177: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
546
- 178: <span class="ruby-keyword kw">begin</span>
547
- 179: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
548
- 180: <span class="ruby-identifier">pid2</span> = <span class="ruby-identifier">fork</span>
549
- 181: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid2</span>.<span class="ruby-identifier">nil?</span>
550
- 182: <span class="ruby-identifier">srand</span>
551
- 183: <span class="ruby-keyword kw">yield</span>
552
- 184: <span class="ruby-keyword kw">end</span>
553
- 185: <span class="ruby-keyword kw">else</span>
554
- 186: <span class="ruby-identifier">srand</span>
555
- 187: <span class="ruby-keyword kw">yield</span>
556
- 188: <span class="ruby-keyword kw">end</span>
557
- 189: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
558
- 190: <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
559
- 191: <span class="ruby-keyword kw">ensure</span>
560
- 192: <span class="ruby-identifier">exit!</span>
561
- 193: <span class="ruby-keyword kw">end</span>
562
- 194: <span class="ruby-keyword kw">else</span>
563
- 195: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
564
- 196: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
565
- 197: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
566
- 198: <span class="ruby-keyword kw">else</span>
567
- 199: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
568
- 200: <span class="ruby-keyword kw">end</span>
569
- 201: <span class="ruby-keyword kw">end</span>
570
- 202: <span class="ruby-keyword kw">end</span>
542
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 176</span>
543
+ 176: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">safe_fork</span>(<span class="ruby-identifier">current_location</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">double_fork</span> = <span class="ruby-keyword kw">false</span>)
544
+ 177: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">fork</span>
545
+ 178: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
546
+ 179: <span class="ruby-keyword kw">begin</span>
547
+ 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
548
+ 181: <span class="ruby-identifier">pid2</span> = <span class="ruby-identifier">fork</span>
549
+ 182: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid2</span>.<span class="ruby-identifier">nil?</span>
550
+ 183: <span class="ruby-identifier">srand</span>
551
+ 184: <span class="ruby-keyword kw">yield</span>
552
+ 185: <span class="ruby-keyword kw">end</span>
553
+ 186: <span class="ruby-keyword kw">else</span>
554
+ 187: <span class="ruby-identifier">srand</span>
555
+ 188: <span class="ruby-keyword kw">yield</span>
556
+ 189: <span class="ruby-keyword kw">end</span>
557
+ 190: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
558
+ 191: <span class="ruby-identifier">print_exception</span>(<span class="ruby-identifier">current_location</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
559
+ 192: <span class="ruby-keyword kw">ensure</span>
560
+ 193: <span class="ruby-identifier">exit!</span>
561
+ 194: <span class="ruby-keyword kw">end</span>
562
+ 195: <span class="ruby-keyword kw">else</span>
563
+ 196: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
564
+ 197: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
565
+ 198: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
566
+ 199: <span class="ruby-keyword kw">else</span>
567
+ 200: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
568
+ 201: <span class="ruby-keyword kw">end</span>
569
+ 202: <span class="ruby-keyword kw">end</span>
570
+ 203: <span class="ruby-keyword kw">end</span>
571
571
  </pre>
572
572
  </div>
573
573
  </div>
574
574
  </div>
575
575
  <div class="method">
576
576
  <div class="title">
577
- <a name="M000090"></a><b>sanitize_spawn_options</b>(options)
577
+ <a name="M000091"></a><b>sanitize_spawn_options</b>(options)
578
578
  </div>
579
579
  <div class="sourcecode">
580
- <p class="source-link">[ <a href="javascript:toggleSource('M000090_source')" id="l_M000090_source">show source</a> ]</p>
581
- <div id="M000090_source" class="dyn-source">
580
+ <p class="source-link">[ <a href="javascript:toggleSource('M000091_source')" id="l_M000091_source">show source</a> ]</p>
581
+ <div id="M000091_source" class="dyn-source">
582
582
  <pre>
583
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 391</span>
584
- 391: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
585
- 392: <span class="ruby-identifier">defaults</span> = {
586
- 393: <span class="ruby-value str">&quot;lower_privilege&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>,
587
- 394: <span class="ruby-value str">&quot;lowest_user&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;nobody&quot;</span>,
588
- 395: <span class="ruby-value str">&quot;environment&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;production&quot;</span>,
589
- 396: <span class="ruby-value str">&quot;app_type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rails&quot;</span>,
590
- 397: <span class="ruby-value str">&quot;spawn_method&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;smart-lv2&quot;</span>,
591
- 398: <span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
592
- 399: <span class="ruby-value str">&quot;app_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
593
- 400: <span class="ruby-value str">&quot;print_exceptions&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
594
- 401: }
595
- 402: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
596
- 403: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>])
597
- 404: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
598
- 405: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
599
- 406: <span class="ruby-comment cmt"># Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.</span>
600
- 407: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>])
601
- 408: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
602
- 409: <span class="ruby-keyword kw">end</span>
583
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 392</span>
584
+ 392: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
585
+ 393: <span class="ruby-identifier">defaults</span> = {
586
+ 394: <span class="ruby-value str">&quot;lower_privilege&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>,
587
+ 395: <span class="ruby-value str">&quot;lowest_user&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;nobody&quot;</span>,
588
+ 396: <span class="ruby-value str">&quot;environment&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;production&quot;</span>,
589
+ 397: <span class="ruby-value str">&quot;app_type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rails&quot;</span>,
590
+ 398: <span class="ruby-value str">&quot;spawn_method&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;smart-lv2&quot;</span>,
591
+ 399: <span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
592
+ 400: <span class="ruby-value str">&quot;app_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
593
+ 401: <span class="ruby-value str">&quot;print_exceptions&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
594
+ 402: }
595
+ 403: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
596
+ 404: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;lower_privilege&quot;</span>])
597
+ 405: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
598
+ 406: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_spawner_timeout&quot;</span>].<span class="ruby-identifier">to_i</span>
599
+ 407: <span class="ruby-comment cmt"># Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.</span>
600
+ 408: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_exceptions&quot;</span>])
601
+ 409: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
602
+ 410: <span class="ruby-keyword kw">end</span>
603
603
  </pre>
604
604
  </div>
605
605
  </div>
606
606
  </div>
607
607
  <div class="method">
608
608
  <div class="title">
609
- <a name="M000088"></a><b>switch_to_user</b>(user)
609
+ <a name="M000089"></a><b>switch_to_user</b>(user)
610
610
  </div>
611
611
  <div class="sourcecode">
612
- <p class="source-link">[ <a href="javascript:toggleSource('M000088_source')" id="l_M000088_source">show source</a> ]</p>
613
- <div id="M000088_source" class="dyn-source">
612
+ <p class="source-link">[ <a href="javascript:toggleSource('M000089_source')" id="l_M000089_source">show source</a> ]</p>
613
+ <div id="M000089_source" class="dyn-source">
614
614
  <pre>
615
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 354</span>
616
- 354: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">user</span>)
617
- 355: <span class="ruby-keyword kw">begin</span>
618
- 356: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
619
- 357: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">user</span>)
620
- 358: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">user</span>
621
- 359: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">uid</span>
622
- 360: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
623
- 361: <span class="ruby-keyword kw">else</span>
624
- 362: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-identifier">user</span>)
625
- 363: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">name</span>
626
- 364: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">user</span>
627
- 365: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
628
- 366: <span class="ruby-keyword kw">end</span>
629
- 367: <span class="ruby-keyword kw">rescue</span>
630
- 368: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
631
- 369: <span class="ruby-keyword kw">end</span>
632
- 370: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
633
- 371: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
634
- 372: <span class="ruby-keyword kw">else</span>
635
- 373: <span class="ruby-comment cmt"># Some systems are broken. initgroups can fail because of</span>
636
- 374: <span class="ruby-comment cmt"># all kinds of stupid reasons. So we ignore any errors</span>
637
- 375: <span class="ruby-comment cmt"># raised by initgroups.</span>
638
- 376: <span class="ruby-keyword kw">begin</span>
639
- 377: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">initgroups</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">gid</span>)
640
- 378: <span class="ruby-keyword kw">rescue</span>
641
- 379: <span class="ruby-keyword kw">end</span>
642
- 380: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setgid</span>(<span class="ruby-identifier">gid</span>)
643
- 381: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setuid</span>(<span class="ruby-identifier">uid</span>)
644
- 382: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HOME'</span>] = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">dir</span>
645
- 383: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
646
- 384: <span class="ruby-keyword kw">end</span>
647
- 385: <span class="ruby-keyword kw">end</span>
615
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 355</span>
616
+ 355: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_user</span>(<span class="ruby-identifier">user</span>)
617
+ 356: <span class="ruby-keyword kw">begin</span>
618
+ 357: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
619
+ 358: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">user</span>)
620
+ 359: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">user</span>
621
+ 360: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">uid</span>
622
+ 361: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
623
+ 362: <span class="ruby-keyword kw">else</span>
624
+ 363: <span class="ruby-identifier">pw</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-identifier">user</span>)
625
+ 364: <span class="ruby-identifier">username</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">name</span>
626
+ 365: <span class="ruby-identifier">uid</span> = <span class="ruby-identifier">user</span>
627
+ 366: <span class="ruby-identifier">gid</span> = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">gid</span>
628
+ 367: <span class="ruby-keyword kw">end</span>
629
+ 368: <span class="ruby-keyword kw">rescue</span>
630
+ 369: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
631
+ 370: <span class="ruby-keyword kw">end</span>
632
+ 371: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
633
+ 372: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
634
+ 373: <span class="ruby-keyword kw">else</span>
635
+ 374: <span class="ruby-comment cmt"># Some systems are broken. initgroups can fail because of</span>
636
+ 375: <span class="ruby-comment cmt"># all kinds of stupid reasons. So we ignore any errors</span>
637
+ 376: <span class="ruby-comment cmt"># raised by initgroups.</span>
638
+ 377: <span class="ruby-keyword kw">begin</span>
639
+ 378: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">initgroups</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">gid</span>)
640
+ 379: <span class="ruby-keyword kw">rescue</span>
641
+ 380: <span class="ruby-keyword kw">end</span>
642
+ 381: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setgid</span>(<span class="ruby-identifier">gid</span>)
643
+ 382: <span class="ruby-constant">Process</span><span class="ruby-operator">::</span><span class="ruby-constant">Sys</span>.<span class="ruby-identifier">setuid</span>(<span class="ruby-identifier">uid</span>)
644
+ 383: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HOME'</span>] = <span class="ruby-identifier">pw</span>.<span class="ruby-identifier">dir</span>
645
+ 384: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
646
+ 385: <span class="ruby-keyword kw">end</span>
647
+ 386: <span class="ruby-keyword kw">end</span>
648
648
  </pre>
649
649
  </div>
650
650
  </div>
651
651
  </div>
652
652
  <div class="method">
653
653
  <div class="title">
654
- <a name="M000089"></a><b>to_boolean</b>(value)
654
+ <a name="M000090"></a><b>to_boolean</b>(value)
655
655
  </div>
656
656
  <div class="sourcecode">
657
- <p class="source-link">[ <a href="javascript:toggleSource('M000089_source')" id="l_M000089_source">show source</a> ]</p>
658
- <div id="M000089_source" class="dyn-source">
657
+ <p class="source-link">[ <a href="javascript:toggleSource('M000090_source')" id="l_M000090_source">show source</a> ]</p>
658
+ <div id="M000090_source" class="dyn-source">
659
659
  <pre>
660
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 387</span>
661
- 387: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">value</span>)
662
- 388: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;false&quot;</span>)
663
- 389: <span class="ruby-keyword kw">end</span>
660
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 388</span>
661
+ 388: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">value</span>)
662
+ 389: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;false&quot;</span>)
663
+ 390: <span class="ruby-keyword kw">end</span>
664
664
  </pre>
665
665
  </div>
666
666
  </div>
667
667
  </div>
668
668
  <div class="method">
669
669
  <div class="title">
670
- <a name="M000086"></a><b>unmarshal_and_raise_errors</b>(channel, print_exception = nil, app_type = &quot;rails&quot;)
670
+ <a name="M000087"></a><b>unmarshal_and_raise_errors</b>(channel, print_exception = nil, app_type = &quot;rails&quot;)
671
671
  </div>
672
672
  <div class="description">
673
673
  <p>
674
674
  Receive status information that was sent to <tt>channel</tt> by <a
675
- href="Utils.html#M000085">report_app_init_status</a>. If an error occured
675
+ href="Utils.html#M000086">report_app_init_status</a>. If an error occured
676
676
  according to the received information, then an appropriate exception will
677
677
  be raised.
678
678
  </p>
679
679
  <p>
680
- If <tt><a href="Utils.html#M000083">print_exception</a></tt> evaluates to
680
+ If <tt><a href="Utils.html#M000084">print_exception</a></tt> evaluates to
681
681
  true, then the exception message and the backtrace will also be printed.
682
682
  Where it is printed to depends on the type of <tt><a
683
- href="Utils.html#M000083">print_exception</a></tt>:
683
+ href="Utils.html#M000084">print_exception</a></tt>:
684
684
  </p>
685
685
  <ul>
686
686
  <li>If it responds to #puts, then the exception information will be printed
@@ -710,87 +710,87 @@ occurred while receiving the information through the channel.
710
710
  </ul>
711
711
  </div>
712
712
  <div class="sourcecode">
713
- <p class="source-link">[ <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show source</a> ]</p>
714
- <div id="M000086_source" class="dyn-source">
713
+ <p class="source-link">[ <a href="javascript:toggleSource('M000087_source')" id="l_M000087_source">show source</a> ]</p>
714
+ <div id="M000087_source" class="dyn-source">
715
715
  <pre>
716
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 302</span>
717
- 302: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">print_exception</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">app_type</span> = <span class="ruby-value str">&quot;rails&quot;</span>)
718
- 303: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
719
- 304: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
720
- 305: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EOFError</span>, <span class="ruby-value str">&quot;Unexpected end-of-file detected.&quot;</span>
721
- 306: <span class="ruby-keyword kw">end</span>
722
- 307: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
723
- 308: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
724
- 309: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
725
- 310: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
726
- 311: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(
727
- 312: <span class="ruby-node">&quot;Application '#{@app_root}' raised an exception: &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
728
- 313: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>,
729
- 314: <span class="ruby-identifier">child_exception</span>,
730
- 315: <span class="ruby-identifier">app_type</span>,
731
- 316: <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
732
- 317: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exit'</span>
733
- 318: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
734
- 319: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
735
- 320: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Application '#{@app_root}' exited during startup&quot;</span>,
736
- 321: <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">app_type</span>, <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
737
- 322: <span class="ruby-keyword kw">else</span>
738
- 323: <span class="ruby-identifier">exception</span> = <span class="ruby-keyword kw">nil</span>
739
- 324: <span class="ruby-keyword kw">end</span>
740
- 325:
741
- 326: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exception</span>
742
- 327: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:puts</span>)
743
- 328: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">print_exception</span>)
744
- 329: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_str</span>)
745
- 330: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">to_str</span>
746
- 331: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'a'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
747
- 332: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">f</span>)
748
- 333: <span class="ruby-keyword kw">end</span>
749
- 334: <span class="ruby-keyword kw">else</span>
750
- 335: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>)
751
- 336: <span class="ruby-keyword kw">end</span>
752
- 337: <span class="ruby-keyword kw">end</span>
753
- 338: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>
754
- 339: <span class="ruby-keyword kw">end</span>
716
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 303</span>
717
+ 303: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">print_exception</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">app_type</span> = <span class="ruby-value str">&quot;rails&quot;</span>)
718
+ 304: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
719
+ 305: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
720
+ 306: <span class="ruby-identifier">raise</span> <span class="ruby-constant">EOFError</span>, <span class="ruby-value str">&quot;Unexpected end-of-file detected.&quot;</span>
721
+ 307: <span class="ruby-keyword kw">end</span>
722
+ 308: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
723
+ 309: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
724
+ 310: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
725
+ 311: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
726
+ 312: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(
727
+ 313: <span class="ruby-node">&quot;Application '#{@app_root}' raised an exception: &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
728
+ 314: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>,
729
+ 315: <span class="ruby-identifier">child_exception</span>,
730
+ 316: <span class="ruby-identifier">app_type</span>,
731
+ 317: <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
732
+ 318: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exit'</span>
733
+ 319: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>)
734
+ 320: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
735
+ 321: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Application '#{@app_root}' exited during startup&quot;</span>,
736
+ 322: <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">app_type</span>, <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">stderr</span>)
737
+ 323: <span class="ruby-keyword kw">else</span>
738
+ 324: <span class="ruby-identifier">exception</span> = <span class="ruby-keyword kw">nil</span>
739
+ 325: <span class="ruby-keyword kw">end</span>
740
+ 326:
741
+ 327: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exception</span>
742
+ 328: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:puts</span>)
743
+ 329: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">print_exception</span>)
744
+ 330: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_str</span>)
745
+ 331: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">to_str</span>
746
+ 332: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'a'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
747
+ 333: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">f</span>)
748
+ 334: <span class="ruby-keyword kw">end</span>
749
+ 335: <span class="ruby-keyword kw">else</span>
750
+ 336: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>)
751
+ 337: <span class="ruby-keyword kw">end</span>
752
+ 338: <span class="ruby-keyword kw">end</span>
753
+ 339: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>
754
+ 340: <span class="ruby-keyword kw">end</span>
755
755
  </pre>
756
756
  </div>
757
757
  </div>
758
758
  </div>
759
759
  <div class="method">
760
760
  <div class="title">
761
- <a name="M000082"></a><b>unmarshal_exception</b>(data)
761
+ <a name="M000083"></a><b>unmarshal_exception</b>(data)
762
762
  </div>
763
763
  <div class="sourcecode">
764
- <p class="source-link">[ <a href="javascript:toggleSource('M000082_source')" id="l_M000082_source">show source</a> ]</p>
765
- <div id="M000082_source" class="dyn-source">
764
+ <p class="source-link">[ <a href="javascript:toggleSource('M000083_source')" id="l_M000083_source">show source</a> ]</p>
765
+ <div id="M000083_source" class="dyn-source">
766
766
  <pre>
767
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 127</span>
768
- 127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">data</span>)
769
- 128: <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">data</span>)
770
- 129: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:is_initialization_error</span>]
771
- 130: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>]
772
- 131: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>])
773
- 132: <span class="ruby-keyword kw">else</span>
774
- 133: <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>
775
- 134: <span class="ruby-keyword kw">end</span>
776
- 135:
777
- 136: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>]
778
- 137: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">to_s</span>
779
- 138: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">AppInitError</span>
780
- 139: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">FrameworkInitError</span>.<span class="ruby-identifier">to_s</span>
781
- 140: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">FrameworkInitError</span>
782
- 141: <span class="ruby-keyword kw">else</span>
783
- 142: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">InitializationError</span>
784
- 143: <span class="ruby-keyword kw">end</span>
785
- 144: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">child_exception</span>)
786
- 145: <span class="ruby-keyword kw">else</span>
787
- 146: <span class="ruby-keyword kw">begin</span>
788
- 147: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:exception</span>])
789
- 148: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
790
- 149: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:backtrace</span>])
791
- 150: <span class="ruby-keyword kw">end</span>
792
- 151: <span class="ruby-keyword kw">end</span>
793
- 152: <span class="ruby-keyword kw">end</span>
767
+ <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 128</span>
768
+ 128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">data</span>)
769
+ 129: <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">data</span>)
770
+ 130: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:is_initialization_error</span>]
771
+ 131: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>]
772
+ 132: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>])
773
+ 133: <span class="ruby-keyword kw">else</span>
774
+ 134: <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>
775
+ 135: <span class="ruby-keyword kw">end</span>
776
+ 136:
777
+ 137: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>]
778
+ 138: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">to_s</span>
779
+ 139: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">AppInitError</span>
780
+ 140: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">FrameworkInitError</span>.<span class="ruby-identifier">to_s</span>
781
+ 141: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">FrameworkInitError</span>
782
+ 142: <span class="ruby-keyword kw">else</span>
783
+ 143: <span class="ruby-identifier">exception_class</span> = <span class="ruby-constant">InitializationError</span>
784
+ 144: <span class="ruby-keyword kw">end</span>
785
+ 145: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">child_exception</span>)
786
+ 146: <span class="ruby-keyword kw">else</span>
787
+ 147: <span class="ruby-keyword kw">begin</span>
788
+ 148: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:exception</span>])
789
+ 149: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
790
+ 150: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">UnknownError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:message</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:class</span>], <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:backtrace</span>])
791
+ 151: <span class="ruby-keyword kw">end</span>
792
+ 152: <span class="ruby-keyword kw">end</span>
793
+ 153: <span class="ruby-keyword kw">end</span>
794
794
  </pre>
795
795
  </div>
796
796
  </div>