passenger 3.0.3 → 3.0.4

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 (621) hide show
  1. data/NEWS +14 -0
  2. data/ext/apache2/Hooks.cpp +2 -2
  3. data/ext/boost/thread/exceptions.hpp +8 -1
  4. data/ext/common/Constants.h +1 -1
  5. data/ext/nginx/Configuration.c +2 -1
  6. data/lib/phusion_passenger.rb +1 -1
  7. metadata +4 -618
  8. data/doc/cxxapi/AbstractSpawnManager_8h-source.html +0 -138
  9. data/doc/cxxapi/AbstractSpawnManager_8h_source.html +0 -141
  10. data/doc/cxxapi/Account_8h-source.html +0 -202
  11. data/doc/cxxapi/Account_8h_source.html +0 -206
  12. data/doc/cxxapi/AccountsDatabase_8h-source.html +0 -158
  13. data/doc/cxxapi/AccountsDatabase_8h_source.html +0 -161
  14. data/doc/cxxapi/AgentBase_8h_source.html +0 -70
  15. data/doc/cxxapi/AgentsStarter_8h-source.html +0 -79
  16. data/doc/cxxapi/AgentsStarter_8h_source.html +0 -112
  17. data/doc/cxxapi/BCrypt_8h-source.html +0 -101
  18. data/doc/cxxapi/BCrypt_8h_source.html +0 -104
  19. data/doc/cxxapi/BacktracesServer_8h-source.html +0 -87
  20. data/doc/cxxapi/Base64_8h-source.html +0 -85
  21. data/doc/cxxapi/Blowfish_8h-source.html +0 -131
  22. data/doc/cxxapi/Blowfish_8h_source.html +0 -134
  23. data/doc/cxxapi/Bucket_8h-source.html +0 -115
  24. data/doc/cxxapi/Bucket_8h_source.html +0 -118
  25. data/doc/cxxapi/CachedFileStat_8h-source.html +0 -79
  26. data/doc/cxxapi/Configuration_8h-source.html +0 -432
  27. data/doc/cxxapi/Configuration_8h_source.html +0 -435
  28. data/doc/cxxapi/Constants_8h-source.html +0 -71
  29. data/doc/cxxapi/Constants_8h_source.html +0 -79
  30. data/doc/cxxapi/ContentHandler_8h-source.html +0 -92
  31. data/doc/cxxapi/ContentHandler_8h_source.html +0 -95
  32. data/doc/cxxapi/DirectoryMapper_8h-source.html +0 -324
  33. data/doc/cxxapi/DirectoryMapper_8h_source.html +0 -311
  34. data/doc/cxxapi/EventedClient_8h_source.html +0 -733
  35. data/doc/cxxapi/EventedMessageServer_8h_source.html +0 -358
  36. data/doc/cxxapi/EventedServer_8h-source.html +0 -415
  37. data/doc/cxxapi/EventedServer_8h_source.html +0 -326
  38. data/doc/cxxapi/Exceptions_8h-source.html +0 -363
  39. data/doc/cxxapi/Exceptions_8h_source.html +0 -393
  40. data/doc/cxxapi/FileChangeChecker_8h-source.html +0 -237
  41. data/doc/cxxapi/FileDescriptor_8h-source.html +0 -206
  42. data/doc/cxxapi/FileDescriptor_8h_source.html +0 -324
  43. data/doc/cxxapi/Hooks_8h-source.html +0 -73
  44. data/doc/cxxapi/Hooks_8h_source.html +0 -76
  45. data/doc/cxxapi/HttpStatusExtractor_8h-source.html +0 -379
  46. data/doc/cxxapi/HttpStatusExtractor_8h_source.html +0 -382
  47. data/doc/cxxapi/IniFile_8h_source.html +0 -527
  48. data/doc/cxxapi/LoggingServer_8h-source.html +0 -165
  49. data/doc/cxxapi/Logging_8h-source.html +0 -709
  50. data/doc/cxxapi/Logging_8h_source.html +0 -796
  51. data/doc/cxxapi/MessageChannel_8h-source.html +0 -852
  52. data/doc/cxxapi/MessageChannel_8h_source.html +0 -776
  53. data/doc/cxxapi/MessageClient_8h-source.html +0 -297
  54. data/doc/cxxapi/MessageClient_8h_source.html +0 -328
  55. data/doc/cxxapi/MessageReadersWriters_8h-source.html +0 -451
  56. data/doc/cxxapi/MessageReadersWriters_8h_source.html +0 -539
  57. data/doc/cxxapi/MessageServer_8h-source.html +0 -607
  58. data/doc/cxxapi/MessageServer_8h_source.html +0 -612
  59. data/doc/cxxapi/PoolOptions_8h-source.html +0 -511
  60. data/doc/cxxapi/PoolOptions_8h_source.html +0 -549
  61. data/doc/cxxapi/Process_8h-source.html +0 -283
  62. data/doc/cxxapi/Process_8h_source.html +0 -286
  63. data/doc/cxxapi/RandomGenerator_8h-source.html +0 -183
  64. data/doc/cxxapi/RandomGenerator_8h_source.html +0 -191
  65. data/doc/cxxapi/ResourceLocator_8h-source.html +0 -104
  66. data/doc/cxxapi/ResourceLocator_8h_source.html +0 -166
  67. data/doc/cxxapi/SafeLibev_8h_source.html +0 -180
  68. data/doc/cxxapi/ScgiRequestParser_8h-source.html +0 -400
  69. data/doc/cxxapi/ScgiRequestParser_8h_source.html +0 -406
  70. data/doc/cxxapi/ServerInstanceDir_8h-source.html +0 -356
  71. data/doc/cxxapi/ServerInstanceDir_8h_source.html +0 -378
  72. data/doc/cxxapi/Session_8h-source.html +0 -496
  73. data/doc/cxxapi/Session_8h_source.html +0 -501
  74. data/doc/cxxapi/SpawnManager_8h-source.html +0 -632
  75. data/doc/cxxapi/SpawnManager_8h_source.html +0 -647
  76. data/doc/cxxapi/StaticContentHandler_8h-source.html +0 -65
  77. data/doc/cxxapi/StaticContentHandler_8h_source.html +0 -68
  78. data/doc/cxxapi/StaticString_8h-source.html +0 -214
  79. data/doc/cxxapi/StaticString_8h_source.html +0 -329
  80. data/doc/cxxapi/StringListCreator_8h-source.html +0 -111
  81. data/doc/cxxapi/StringListCreator_8h_source.html +0 -114
  82. data/doc/cxxapi/SystemTime_8h-source.html +0 -222
  83. data/doc/cxxapi/Timer_8h-source.html +0 -157
  84. data/doc/cxxapi/Utils_8h-source.html +0 -688
  85. data/doc/cxxapi/Utils_8h_source.html +0 -459
  86. data/doc/cxxapi/Version_8h-source.html +0 -59
  87. data/doc/cxxapi/annotated.html +0 -87
  88. data/doc/cxxapi/apache2_2Configuration_8h-source.html +0 -79
  89. data/doc/cxxapi/apache2_2Configuration_8h_source.html +0 -82
  90. data/doc/cxxapi/classAgentWatcher-members.html +0 -54
  91. data/doc/cxxapi/classAgentWatcher.html +0 -419
  92. data/doc/cxxapi/classClient-members.html +0 -38
  93. data/doc/cxxapi/classClient.html +0 -123
  94. data/doc/cxxapi/classHooks-members.html +0 -40
  95. data/doc/cxxapi/classHooks.html +0 -153
  96. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +0 -40
  97. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +0 -187
  98. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +0 -1
  99. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +0 -1
  100. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
  101. data/doc/cxxapi/classPassenger_1_1ArgumentException-members.html +0 -36
  102. data/doc/cxxapi/classPassenger_1_1ArgumentException.html +0 -56
  103. data/doc/cxxapi/classPassenger_1_1ArrayMessage-members.html +0 -37
  104. data/doc/cxxapi/classPassenger_1_1ArrayMessage.html +0 -113
  105. data/doc/cxxapi/classPassenger_1_1ArrayReader-members.html +0 -33
  106. data/doc/cxxapi/classPassenger_1_1ArrayReader.html +0 -47
  107. data/doc/cxxapi/classPassenger_1_1BacktracesServer-members.html +0 -36
  108. data/doc/cxxapi/classPassenger_1_1BacktracesServer.html +0 -107
  109. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.map +0 -1
  110. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.md5 +0 -1
  111. data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.png +0 -0
  112. data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +0 -38
  113. data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +0 -112
  114. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +0 -36
  115. data/doc/cxxapi/classPassenger_1_1BusyException.html +0 -54
  116. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +0 -36
  117. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +0 -51
  118. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -41
  119. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -223
  120. data/doc/cxxapi/classPassenger_1_1EOFException-members.html +0 -36
  121. data/doc/cxxapi/classPassenger_1_1EOFException.html +0 -61
  122. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +0 -1
  123. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +0 -1
  124. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
  125. data/doc/cxxapi/classPassenger_1_1EventFd-members.html +0 -36
  126. data/doc/cxxapi/classPassenger_1_1EventFd.html +0 -52
  127. data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +0 -59
  128. data/doc/cxxapi/classPassenger_1_1EventedClient.html +0 -531
  129. data/doc/cxxapi/classPassenger_1_1EventedMessageServer-members.html +0 -37
  130. data/doc/cxxapi/classPassenger_1_1EventedMessageServer.html +0 -59
  131. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.map +0 -3
  132. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.md5 +0 -1
  133. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.png +0 -0
  134. data/doc/cxxapi/classPassenger_1_1EventedServer-members.html +0 -37
  135. data/doc/cxxapi/classPassenger_1_1EventedServer.html +0 -93
  136. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.map +0 -3
  137. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.md5 +0 -1
  138. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.png +0 -0
  139. data/doc/cxxapi/classPassenger_1_1FileChangeChecker-members.html +0 -37
  140. data/doc/cxxapi/classPassenger_1_1FileChangeChecker.html +0 -166
  141. data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +0 -41
  142. data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +0 -178
  143. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +0 -36
  144. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +0 -52
  145. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +0 -36
  146. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +0 -58
  147. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +0 -1
  148. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +0 -1
  149. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  150. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +0 -41
  151. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +0 -66
  152. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +0 -1
  153. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +0 -1
  154. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  155. data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor-members.html +0 -39
  156. data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +0 -128
  157. data/doc/cxxapi/classPassenger_1_1IOException-members.html +0 -36
  158. data/doc/cxxapi/classPassenger_1_1IOException.html +0 -61
  159. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +0 -2
  160. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +0 -1
  161. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  162. data/doc/cxxapi/classPassenger_1_1MemZeroGuard-members.html +0 -36
  163. data/doc/cxxapi/classPassenger_1_1MemZeroGuard.html +0 -147
  164. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -57
  165. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -839
  166. data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +0 -49
  167. data/doc/cxxapi/classPassenger_1_1MessageServer.html +0 -407
  168. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +0 -36
  169. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +0 -58
  170. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +0 -3
  171. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +0 -1
  172. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
  173. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +0 -41
  174. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +0 -165
  175. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +0 -3
  176. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +0 -1
  177. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
  178. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +0 -39
  179. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +0 -173
  180. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.map +0 -1
  181. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.md5 +0 -1
  182. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.png +0 -0
  183. data/doc/cxxapi/classPassenger_1_1Process-members.html +0 -44
  184. data/doc/cxxapi/classPassenger_1_1Process.html +0 -290
  185. data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +0 -37
  186. data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +0 -79
  187. data/doc/cxxapi/classPassenger_1_1ResourceLocator-members.html +0 -36
  188. data/doc/cxxapi/classPassenger_1_1ResourceLocator.html +0 -51
  189. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +0 -36
  190. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +0 -54
  191. data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +0 -36
  192. data/doc/cxxapi/classPassenger_1_1SafeLibev.html +0 -51
  193. data/doc/cxxapi/classPassenger_1_1ScalarMessage-members.html +0 -37
  194. data/doc/cxxapi/classPassenger_1_1ScalarMessage.html +0 -76
  195. data/doc/cxxapi/classPassenger_1_1ScalarReader-members.html +0 -33
  196. data/doc/cxxapi/classPassenger_1_1ScalarReader.html +0 -47
  197. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +0 -50
  198. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +0 -285
  199. data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +0 -36
  200. data/doc/cxxapi/classPassenger_1_1SecurityException.html +0 -56
  201. data/doc/cxxapi/classPassenger_1_1Session-members.html +0 -53
  202. data/doc/cxxapi/classPassenger_1_1Session.html +0 -556
  203. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +0 -1
  204. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +0 -1
  205. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
  206. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +0 -39
  207. data/doc/cxxapi/classPassenger_1_1SpawnException.html +0 -101
  208. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +0 -42
  209. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +0 -292
  210. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +0 -1
  211. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +0 -1
  212. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
  213. data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +0 -54
  214. data/doc/cxxapi/classPassenger_1_1StandardSession.html +0 -394
  215. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +0 -1
  216. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +0 -1
  217. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
  218. data/doc/cxxapi/classPassenger_1_1StaticString-members.html +0 -36
  219. data/doc/cxxapi/classPassenger_1_1StaticString.html +0 -56
  220. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +0 -40
  221. data/doc/cxxapi/classPassenger_1_1SystemException.html +0 -155
  222. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +0 -2
  223. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +0 -1
  224. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  225. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +0 -43
  226. data/doc/cxxapi/classPassenger_1_1SystemTime.html +0 -173
  227. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +0 -40
  228. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +0 -61
  229. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +0 -1
  230. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +0 -1
  231. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
  232. data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +0 -36
  233. data/doc/cxxapi/classPassenger_1_1TimeoutException.html +0 -54
  234. data/doc/cxxapi/classPassenger_1_1Timer-members.html +0 -38
  235. data/doc/cxxapi/classPassenger_1_1Timer.html +0 -163
  236. data/doc/cxxapi/classPassenger_1_1Uint16Message-members.html +0 -36
  237. data/doc/cxxapi/classPassenger_1_1Uint16Message.html +0 -51
  238. data/doc/cxxapi/classPassenger_1_1Uint16Reader-members.html +0 -33
  239. data/doc/cxxapi/classPassenger_1_1Uint16Reader.html +0 -47
  240. data/doc/cxxapi/classPassenger_1_1Uint32Message-members.html +0 -36
  241. data/doc/cxxapi/classPassenger_1_1Uint32Message.html +0 -51
  242. data/doc/cxxapi/classPassenger_1_1Uint32Reader-members.html +0 -33
  243. data/doc/cxxapi/classPassenger_1_1Uint32Reader.html +0 -47
  244. data/doc/cxxapi/classServer-members.html +0 -36
  245. data/doc/cxxapi/classServer.html +0 -49
  246. data/doc/cxxapi/classServerInstanceDirToucher-members.html +0 -36
  247. data/doc/cxxapi/classServerInstanceDirToucher.html +0 -47
  248. data/doc/cxxapi/classes.html +0 -52
  249. data/doc/cxxapi/definitions_8h-source.html +0 -33
  250. data/doc/cxxapi/definitions_8h_source.html +0 -36
  251. data/doc/cxxapi/doxygen.css +0 -532
  252. data/doc/cxxapi/doxygen.png +0 -0
  253. data/doc/cxxapi/files.html +0 -76
  254. data/doc/cxxapi/ftv2blank.png +0 -0
  255. data/doc/cxxapi/ftv2doc.png +0 -0
  256. data/doc/cxxapi/ftv2folderclosed.png +0 -0
  257. data/doc/cxxapi/ftv2folderopen.png +0 -0
  258. data/doc/cxxapi/ftv2lastnode.png +0 -0
  259. data/doc/cxxapi/ftv2link.png +0 -0
  260. data/doc/cxxapi/ftv2mlastnode.png +0 -0
  261. data/doc/cxxapi/ftv2mnode.png +0 -0
  262. data/doc/cxxapi/ftv2node.png +0 -0
  263. data/doc/cxxapi/ftv2plastnode.png +0 -0
  264. data/doc/cxxapi/ftv2pnode.png +0 -0
  265. data/doc/cxxapi/ftv2vertline.png +0 -0
  266. data/doc/cxxapi/functions.html +0 -103
  267. data/doc/cxxapi/functions_0x62.html +0 -82
  268. data/doc/cxxapi/functions_0x63.html +0 -102
  269. data/doc/cxxapi/functions_0x64.html +0 -102
  270. data/doc/cxxapi/functions_0x65.html +0 -88
  271. data/doc/cxxapi/functions_0x66.html +0 -100
  272. data/doc/cxxapi/functions_0x67.html +0 -167
  273. data/doc/cxxapi/functions_0x68.html +0 -88
  274. data/doc/cxxapi/functions_0x69.html +0 -96
  275. data/doc/cxxapi/functions_0x6b.html +0 -80
  276. data/doc/cxxapi/functions_0x6c.html +0 -88
  277. data/doc/cxxapi/functions_0x6d.html +0 -88
  278. data/doc/cxxapi/functions_0x6e.html +0 -86
  279. data/doc/cxxapi/functions_0x6f.html +0 -94
  280. data/doc/cxxapi/functions_0x70.html +0 -94
  281. data/doc/cxxapi/functions_0x72.html +0 -110
  282. data/doc/cxxapi/functions_0x73.html +0 -171
  283. data/doc/cxxapi/functions_0x74.html +0 -85
  284. data/doc/cxxapi/functions_0x75.html +0 -85
  285. data/doc/cxxapi/functions_0x77.html +0 -92
  286. data/doc/cxxapi/functions_0x7e.html +0 -79
  287. data/doc/cxxapi/functions_enum.html +0 -49
  288. data/doc/cxxapi/functions_eval.html +0 -67
  289. data/doc/cxxapi/functions_func.html +0 -531
  290. data/doc/cxxapi/functions_vars.html +0 -278
  291. data/doc/cxxapi/graph_legend.dot +0 -22
  292. data/doc/cxxapi/graph_legend.html +0 -92
  293. data/doc/cxxapi/graph_legend.png +0 -0
  294. data/doc/cxxapi/group__Configuration.html +0 -198
  295. data/doc/cxxapi/group__Configuration.map +0 -3
  296. data/doc/cxxapi/group__Configuration.png +0 -0
  297. data/doc/cxxapi/group__Core.html +0 -46
  298. data/doc/cxxapi/group__Core.map +0 -3
  299. data/doc/cxxapi/group__Core.png +0 -0
  300. data/doc/cxxapi/group__Exceptions.html +0 -53
  301. data/doc/cxxapi/group__Hooks.html +0 -42
  302. data/doc/cxxapi/group__Hooks.map +0 -3
  303. data/doc/cxxapi/group__Hooks.png +0 -0
  304. data/doc/cxxapi/group__Support.html +0 -538
  305. data/doc/cxxapi/hierarchy.html +0 -101
  306. data/doc/cxxapi/index.html +0 -16
  307. data/doc/cxxapi/inherit__graph__0.map +0 -1
  308. data/doc/cxxapi/inherit__graph__0.md5 +0 -1
  309. data/doc/cxxapi/inherit__graph__0.png +0 -0
  310. data/doc/cxxapi/inherit__graph__1.map +0 -1
  311. data/doc/cxxapi/inherit__graph__1.md5 +0 -1
  312. data/doc/cxxapi/inherit__graph__1.png +0 -0
  313. data/doc/cxxapi/inherit__graph__10.map +0 -3
  314. data/doc/cxxapi/inherit__graph__10.md5 +0 -1
  315. data/doc/cxxapi/inherit__graph__10.png +0 -0
  316. data/doc/cxxapi/inherit__graph__11.map +0 -4
  317. data/doc/cxxapi/inherit__graph__11.md5 +0 -1
  318. data/doc/cxxapi/inherit__graph__11.png +0 -0
  319. data/doc/cxxapi/inherit__graph__12.map +0 -3
  320. data/doc/cxxapi/inherit__graph__12.md5 +0 -1
  321. data/doc/cxxapi/inherit__graph__12.png +0 -0
  322. data/doc/cxxapi/inherit__graph__13.map +0 -3
  323. data/doc/cxxapi/inherit__graph__13.md5 +0 -1
  324. data/doc/cxxapi/inherit__graph__13.png +0 -0
  325. data/doc/cxxapi/inherit__graph__14.map +0 -3
  326. data/doc/cxxapi/inherit__graph__14.md5 +0 -1
  327. data/doc/cxxapi/inherit__graph__14.png +0 -0
  328. data/doc/cxxapi/inherit__graph__15.map +0 -3
  329. data/doc/cxxapi/inherit__graph__15.md5 +0 -1
  330. data/doc/cxxapi/inherit__graph__15.png +0 -0
  331. data/doc/cxxapi/inherit__graph__16.map +0 -5
  332. data/doc/cxxapi/inherit__graph__16.md5 +0 -1
  333. data/doc/cxxapi/inherit__graph__16.png +0 -0
  334. data/doc/cxxapi/inherit__graph__17.map +0 -3
  335. data/doc/cxxapi/inherit__graph__17.md5 +0 -1
  336. data/doc/cxxapi/inherit__graph__17.png +0 -0
  337. data/doc/cxxapi/inherit__graph__18.map +0 -3
  338. data/doc/cxxapi/inherit__graph__18.md5 +0 -1
  339. data/doc/cxxapi/inherit__graph__18.png +0 -0
  340. data/doc/cxxapi/inherit__graph__19.map +0 -4
  341. data/doc/cxxapi/inherit__graph__19.md5 +0 -1
  342. data/doc/cxxapi/inherit__graph__19.png +0 -0
  343. data/doc/cxxapi/inherit__graph__2.map +0 -1
  344. data/doc/cxxapi/inherit__graph__2.md5 +0 -1
  345. data/doc/cxxapi/inherit__graph__2.png +0 -0
  346. data/doc/cxxapi/inherit__graph__20.map +0 -3
  347. data/doc/cxxapi/inherit__graph__20.md5 +0 -1
  348. data/doc/cxxapi/inherit__graph__20.png +0 -0
  349. data/doc/cxxapi/inherit__graph__21.map +0 -3
  350. data/doc/cxxapi/inherit__graph__21.md5 +0 -1
  351. data/doc/cxxapi/inherit__graph__21.png +0 -0
  352. data/doc/cxxapi/inherit__graph__22.map +0 -3
  353. data/doc/cxxapi/inherit__graph__22.md5 +0 -1
  354. data/doc/cxxapi/inherit__graph__22.png +0 -0
  355. data/doc/cxxapi/inherit__graph__23.map +0 -3
  356. data/doc/cxxapi/inherit__graph__23.md5 +0 -1
  357. data/doc/cxxapi/inherit__graph__23.png +0 -0
  358. data/doc/cxxapi/inherit__graph__24.map +0 -3
  359. data/doc/cxxapi/inherit__graph__24.md5 +0 -1
  360. data/doc/cxxapi/inherit__graph__24.png +0 -0
  361. data/doc/cxxapi/inherit__graph__25.map +0 -3
  362. data/doc/cxxapi/inherit__graph__25.md5 +0 -1
  363. data/doc/cxxapi/inherit__graph__25.png +0 -0
  364. data/doc/cxxapi/inherit__graph__26.map +0 -3
  365. data/doc/cxxapi/inherit__graph__26.md5 +0 -1
  366. data/doc/cxxapi/inherit__graph__26.png +0 -0
  367. data/doc/cxxapi/inherit__graph__27.map +0 -3
  368. data/doc/cxxapi/inherit__graph__27.md5 +0 -1
  369. data/doc/cxxapi/inherit__graph__27.png +0 -0
  370. data/doc/cxxapi/inherit__graph__28.map +0 -3
  371. data/doc/cxxapi/inherit__graph__28.md5 +0 -1
  372. data/doc/cxxapi/inherit__graph__28.png +0 -0
  373. data/doc/cxxapi/inherit__graph__29.map +0 -3
  374. data/doc/cxxapi/inherit__graph__29.md5 +0 -1
  375. data/doc/cxxapi/inherit__graph__29.png +0 -0
  376. data/doc/cxxapi/inherit__graph__3.map +0 -2
  377. data/doc/cxxapi/inherit__graph__3.md5 +0 -1
  378. data/doc/cxxapi/inherit__graph__3.png +0 -0
  379. data/doc/cxxapi/inherit__graph__30.map +0 -3
  380. data/doc/cxxapi/inherit__graph__30.md5 +0 -1
  381. data/doc/cxxapi/inherit__graph__30.png +0 -0
  382. data/doc/cxxapi/inherit__graph__31.map +0 -4
  383. data/doc/cxxapi/inherit__graph__31.md5 +0 -1
  384. data/doc/cxxapi/inherit__graph__31.png +0 -0
  385. data/doc/cxxapi/inherit__graph__32.map +0 -3
  386. data/doc/cxxapi/inherit__graph__32.md5 +0 -1
  387. data/doc/cxxapi/inherit__graph__32.png +0 -0
  388. data/doc/cxxapi/inherit__graph__33.map +0 -3
  389. data/doc/cxxapi/inherit__graph__33.md5 +0 -1
  390. data/doc/cxxapi/inherit__graph__33.png +0 -0
  391. data/doc/cxxapi/inherit__graph__34.map +0 -3
  392. data/doc/cxxapi/inherit__graph__34.md5 +0 -1
  393. data/doc/cxxapi/inherit__graph__34.png +0 -0
  394. data/doc/cxxapi/inherit__graph__35.map +0 -3
  395. data/doc/cxxapi/inherit__graph__35.md5 +0 -1
  396. data/doc/cxxapi/inherit__graph__35.png +0 -0
  397. data/doc/cxxapi/inherit__graph__36.map +0 -5
  398. data/doc/cxxapi/inherit__graph__36.md5 +0 -1
  399. data/doc/cxxapi/inherit__graph__36.png +0 -0
  400. data/doc/cxxapi/inherit__graph__37.map +0 -3
  401. data/doc/cxxapi/inherit__graph__37.md5 +0 -1
  402. data/doc/cxxapi/inherit__graph__37.png +0 -0
  403. data/doc/cxxapi/inherit__graph__38.map +0 -3
  404. data/doc/cxxapi/inherit__graph__38.md5 +0 -1
  405. data/doc/cxxapi/inherit__graph__38.png +0 -0
  406. data/doc/cxxapi/inherit__graph__39.map +0 -3
  407. data/doc/cxxapi/inherit__graph__39.md5 +0 -1
  408. data/doc/cxxapi/inherit__graph__39.png +0 -0
  409. data/doc/cxxapi/inherit__graph__4.map +0 -3
  410. data/doc/cxxapi/inherit__graph__4.md5 +0 -1
  411. data/doc/cxxapi/inherit__graph__4.png +0 -0
  412. data/doc/cxxapi/inherit__graph__40.map +0 -3
  413. data/doc/cxxapi/inherit__graph__40.md5 +0 -1
  414. data/doc/cxxapi/inherit__graph__40.png +0 -0
  415. data/doc/cxxapi/inherit__graph__5.map +0 -3
  416. data/doc/cxxapi/inherit__graph__5.md5 +0 -1
  417. data/doc/cxxapi/inherit__graph__5.png +0 -0
  418. data/doc/cxxapi/inherit__graph__6.map +0 -3
  419. data/doc/cxxapi/inherit__graph__6.md5 +0 -1
  420. data/doc/cxxapi/inherit__graph__6.png +0 -0
  421. data/doc/cxxapi/inherit__graph__7.map +0 -3
  422. data/doc/cxxapi/inherit__graph__7.md5 +0 -1
  423. data/doc/cxxapi/inherit__graph__7.png +0 -0
  424. data/doc/cxxapi/inherit__graph__8.map +0 -3
  425. data/doc/cxxapi/inherit__graph__8.md5 +0 -1
  426. data/doc/cxxapi/inherit__graph__8.png +0 -0
  427. data/doc/cxxapi/inherit__graph__9.map +0 -3
  428. data/doc/cxxapi/inherit__graph__9.md5 +0 -1
  429. data/doc/cxxapi/inherit__graph__9.png +0 -0
  430. data/doc/cxxapi/inherits.html +0 -165
  431. data/doc/cxxapi/main.html +0 -28
  432. data/doc/cxxapi/md5_8h-source.html +0 -121
  433. data/doc/cxxapi/modules.html +0 -36
  434. data/doc/cxxapi/namespacePassenger.html +0 -553
  435. data/doc/cxxapi/namespacemembers.html +0 -135
  436. data/doc/cxxapi/namespacemembers_enum.html +0 -48
  437. data/doc/cxxapi/namespacemembers_eval.html +0 -57
  438. data/doc/cxxapi/namespacemembers_func.html +0 -111
  439. data/doc/cxxapi/namespacemembers_type.html +0 -54
  440. data/doc/cxxapi/namespaces.html +0 -37
  441. data/doc/cxxapi/nginx_2Configuration_8h-source.html +0 -115
  442. data/doc/cxxapi/nginx_2Configuration_8h_source.html +0 -125
  443. data/doc/cxxapi/ngx__http__passenger__module_8h-source.html +0 -91
  444. data/doc/cxxapi/ngx__http__passenger__module_8h_source.html +0 -94
  445. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +0 -33
  446. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +0 -52
  447. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01StaticString_01_4_01_4-members.html +0 -33
  448. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01StaticString_01_4_01_4.html +0 -52
  449. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +0 -33
  450. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +0 -52
  451. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +0 -36
  452. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +0 -51
  453. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +0 -67
  454. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +0 -647
  455. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +0 -36
  456. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +0 -51
  457. data/doc/cxxapi/tab_b.gif +0 -0
  458. data/doc/cxxapi/tab_l.gif +0 -0
  459. data/doc/cxxapi/tab_r.gif +0 -0
  460. data/doc/cxxapi/tabs.css +0 -105
  461. data/doc/cxxapi/tree.html +0 -249
  462. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  463. data/doc/rdoc/classes/Exception.html +0 -120
  464. data/doc/rdoc/classes/GC.html +0 -113
  465. data/doc/rdoc/classes/IO.html +0 -221
  466. data/doc/rdoc/classes/PhusionPassenger.html +0 -397
  467. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  468. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  469. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  470. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  471. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  472. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  473. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  474. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  475. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  476. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  477. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  478. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  479. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  480. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  481. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  482. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  483. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  484. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  485. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  486. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  487. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  488. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -368
  489. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -299
  490. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -206
  491. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  492. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  493. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  494. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  495. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  496. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  497. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  498. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  499. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  500. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  501. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  502. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  503. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  504. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  505. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  506. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  507. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  508. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  509. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  510. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  511. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +0 -134
  512. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  513. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1972
  514. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  515. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  516. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  517. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  518. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  519. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  520. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -259
  521. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  522. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  523. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  524. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  525. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  526. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  527. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  528. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  529. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  530. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  531. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  532. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  533. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  534. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  535. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  536. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  537. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  538. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  539. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  540. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1543
  541. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  542. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  543. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  544. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  545. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -194
  546. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  547. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  548. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  549. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  550. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  551. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  552. data/doc/rdoc/classes/Process.html +0 -115
  553. data/doc/rdoc/classes/Signal.html +0 -139
  554. data/doc/rdoc/created.rid +0 -1
  555. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -280
  556. data/doc/rdoc/files/README.html +0 -157
  557. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  558. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  559. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  560. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  561. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  562. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  563. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  564. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  565. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  566. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  567. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  568. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  569. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  570. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  571. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  572. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  573. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  574. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  575. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  576. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  577. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  578. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  579. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -132
  580. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  581. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  582. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  583. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -127
  584. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  585. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  586. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  587. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  588. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  589. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  590. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  591. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  592. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  593. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  594. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  595. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  596. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  597. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  598. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  599. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -136
  600. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  601. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  602. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  603. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  604. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -133
  605. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  606. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  607. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  608. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  609. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  610. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  611. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  612. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  613. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  614. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  615. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  616. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  617. data/doc/rdoc/fr_class_index.html +0 -139
  618. data/doc/rdoc/fr_file_index.html +0 -108
  619. data/doc/rdoc/fr_method_index.html +0 -439
  620. data/doc/rdoc/index.html +0 -26
  621. data/doc/rdoc/rdoc-style.css +0 -187
@@ -1,125 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::UnknownError</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::UnknownError</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/exceptions_rb.html">lib/phusion_passenger/exceptions.rb</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- StandardError
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
-
79
-
80
-
81
- <div class="sectiontitle">Methods</div>
82
- <ul>
83
- <li><a href="#M000389">new</a></li>
84
- </ul>
85
-
86
-
87
-
88
-
89
-
90
- <div class="sectiontitle">Attributes</div>
91
- <table border='0' cellpadding='5'>
92
- <tr valign='top'>
93
- <td class='attr-rw'>
94
- [RW]
95
- </td>
96
- <td class='attr-name'>real_class_name</td>
97
- <td class='attr-desc'></td>
98
- </tr>
99
- </table>
100
-
101
- <div class="sectiontitle">Public Class methods</div>
102
- <div class="method">
103
- <div class="title">
104
- <a name="M000389"></a><b>new</b>(message, class_name, backtrace)
105
- </div>
106
- <div class="sourcecode">
107
- <p class="source-link">[ <a href="javascript:toggleSource('M000389_source')" id="l_M000389_source">show source</a> ]</p>
108
- <div id="M000389_source" class="dyn-source">
109
- <pre>
110
- <span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 93</span>
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>)
112
- 94: <span class="ruby-keyword kw">super</span>(<span class="ruby-node">&quot;#{message} (#{class_name})&quot;</span>)
113
- 95: <span class="ruby-identifier">set_backtrace</span>(<span class="ruby-identifier">backtrace</span>)
114
- 96: <span class="ruby-ivar">@real_class_name</span> = <span class="ruby-identifier">class_name</span>
115
- 97: <span class="ruby-keyword kw">end</span>
116
- </pre>
117
- </div>
118
- </div>
119
- </div>
120
- </div>
121
-
122
- </div>
123
-
124
- </body>
125
- </html>
@@ -1,1543 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::Utils</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::Utils</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/utils_rb.html">lib/phusion_passenger/utils.rb</a>
61
- <a href="../../files/lib/phusion_passenger/utils/file_system_watcher_rb.html">lib/phusion_passenger/utils/file_system_watcher.rb</a>
62
- <a href="../../files/lib/phusion_passenger/utils/hosts_file_parser_rb.html">lib/phusion_passenger/utils/hosts_file_parser.rb</a>
63
- <a href="../../files/lib/phusion_passenger/utils/rewindable_input_rb.html">lib/phusion_passenger/utils/rewindable_input.rb</a>
64
- <a href="../../files/lib/phusion_passenger/utils/tmpdir_rb.html">lib/phusion_passenger/utils/tmpdir.rb</a>
65
- <a href="../../files/lib/phusion_passenger/utils/unseekable_socket_rb.html">lib/phusion_passenger/utils/unseekable_socket.rb</a>
66
- </td>
67
- </tr>
68
- </table>
69
- </td>
70
- </tr>
71
- </table>
72
- <!-- banner header -->
73
-
74
- <div id="bodyContent">
75
- <div id="content">
76
-
77
- <div class="description"><p>
78
- Utility functions.
79
- </p>
80
- </div>
81
-
82
-
83
-
84
- <div class="sectiontitle">Methods</div>
85
- <ul>
86
- <li><a href="#M000213">after_handling_requests</a></li>
87
- <li><a href="#M000211">after_loading_app_code</a></li>
88
- <li><a href="#M000200">assert_valid_directory</a></li>
89
- <li><a href="#M000201">assert_valid_file</a></li>
90
- <li><a href="#M000203">assert_valid_groupname</a></li>
91
- <li><a href="#M000202">assert_valid_username</a></li>
92
- <li><a href="#M000210">at_exit</a></li>
93
- <li><a href="#M000212">before_handling_requests</a></li>
94
- <li><a href="#M000199">canonicalize_path</a></li>
95
- <li><a href="#M000223">check_directory_tree_permissions</a></li>
96
- <li><a href="#M000205">close_all_io_objects_for_fds</a></li>
97
- <li><a href="#M000215">connect_to_server</a></li>
98
- <li><a href="#M000204">generate_random_id</a></li>
99
- <li><a href="#M000214">get_socket_address_type</a></li>
100
- <li><a href="#M000224">global_backtrace_report</a></li>
101
- <li><a href="#M000216">local_socket_address?</a></li>
102
- <li><a href="#M000222">lower_privilege</a></li>
103
- <li><a href="#M000221">lower_privilege_called</a></li>
104
- <li><a href="#M000206">marshal_exception</a></li>
105
- <li><a href="#M000229">new</a></li>
106
- <li><a href="#M000230">opens_files?</a></li>
107
- <li><a href="#M000232">passenger_tmpdir</a></li>
108
- <li><a href="#M000231">passenger_tmpdir</a></li>
109
- <li><a href="#M000233">passenger_tmpdir=</a></li>
110
- <li><a href="#M000209">prepare_app_process</a></li>
111
- <li><a href="#M000208">print_exception</a></li>
112
- <li><a href="#M000198">private_class_method</a></li>
113
- <li><a href="#M000218">process_is_alive?</a></li>
114
- <li><a href="#M000219">report_app_init_status</a></li>
115
- <li><a href="#M000217">safe_fork</a></li>
116
- <li><a href="#M000226">sanitize_spawn_options</a></li>
117
- <li><a href="#M000227">split_by_null_into_hash</a></li>
118
- <li><a href="#M000228">split_by_null_into_hash</a></li>
119
- <li><a href="#M000225">to_boolean</a></li>
120
- <li><a href="#M000220">unmarshal_and_raise_errors</a></li>
121
- <li><a href="#M000207">unmarshal_exception</a></li>
122
- </ul>
123
-
124
-
125
-
126
- <div class="sectiontitle">Classes and Modules</div>
127
- Class <a href="Utils/FileSystemWatcher.html" class="link">PhusionPassenger::Utils::FileSystemWatcher</a><br />
128
- Class <a href="Utils/HostsFileParser.html" class="link">PhusionPassenger::Utils::HostsFileParser</a><br />
129
- Class <a href="Utils/PseudoIO.html" class="link">PhusionPassenger::Utils::PseudoIO</a><br />
130
- Class <a href="Utils/RewindableInput.html" class="link">PhusionPassenger::Utils::RewindableInput</a><br />
131
- Class <a href="Utils/UnseekableSocket.html" class="link">PhusionPassenger::Utils::UnseekableSocket</a><br />
132
-
133
-
134
- <div class="sectiontitle">Constants</div>
135
- <table border='0' cellpadding='5'>
136
- <tr valign='top'>
137
- <td class="attr-name">NULL</td>
138
- <td>=</td>
139
- <td class="attr-value">&quot;\0&quot;.freeze</td>
140
- </tr>
141
- <tr valign='top'>
142
- <td class="attr-name">FileSystemWatcher</td>
143
- <td>=</td>
144
- <td class="attr-value">NativeSupport::FileSystemWatcher</td>
145
- </tr>
146
- </table>
147
-
148
-
149
- <div class="sectiontitle">Public Class methods</div>
150
- <div class="method">
151
- <div class="title">
152
- <a name="M000229"></a><b>new</b>(filenames, termination_pipe = nil)
153
- </div>
154
- <div class="sourcecode">
155
- <p class="source-link">[ <a href="javascript:toggleSource('M000229_source')" id="l_M000229_source">show source</a> ]</p>
156
- <div id="M000229_source" class="dyn-source">
157
- <pre>
158
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils/file_system_watcher.rb, line 60</span>
159
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">filenames</span>, <span class="ruby-identifier">termination_pipe</span> = <span class="ruby-keyword kw">nil</span>)
160
- 61: <span class="ruby-comment cmt"># Default parameter values, type conversion and exception</span>
161
- 62: <span class="ruby-comment cmt"># handling in C is too much of a pain.</span>
162
- 63: <span class="ruby-identifier">filenames</span> = <span class="ruby-identifier">filenames</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
163
- 64: <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">to_s</span>
164
- 65: <span class="ruby-keyword kw">end</span>
165
- 66: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_new</span>(<span class="ruby-identifier">filenames</span>, <span class="ruby-identifier">termination_pipe</span>)
166
- 67: <span class="ruby-keyword kw">end</span>
167
- </pre>
168
- </div>
169
- </div>
170
- </div>
171
- <div class="method">
172
- <div class="title">
173
- <a name="M000230"></a><b>opens_files?</b>()
174
- </div>
175
- <div class="sourcecode">
176
- <p class="source-link">[ <a href="javascript:toggleSource('M000230_source')" id="l_M000230_source">show source</a> ]</p>
177
- <div id="M000230_source" class="dyn-source">
178
- <pre>
179
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils/file_system_watcher.rb, line 69</span>
180
- 69: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">opens_files?</span>
181
- 70: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
182
- 71: <span class="ruby-keyword kw">end</span>
183
- </pre>
184
- </div>
185
- </div>
186
- </div>
187
- <div class="sectiontitle">Protected Class methods</div>
188
- <div class="method">
189
- <div class="title">
190
- <a name="M000221"></a><b>lower_privilege_called</b>()
191
- </div>
192
- <div class="description">
193
- <p>
194
- No-op, hook for unit tests.
195
- </p>
196
- </div>
197
- <div class="sourcecode">
198
- <p class="source-link">[ <a href="javascript:toggleSource('M000221_source')" id="l_M000221_source">show source</a> ]</p>
199
- <div id="M000221_source" class="dyn-source">
200
- <pre>
201
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 657</span>
202
- 657: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">lower_privilege_called</span>
203
- 658: <span class="ruby-keyword kw">end</span>
204
- </pre>
205
- </div>
206
- </div>
207
- </div>
208
- <div class="method">
209
- <div class="title">
210
- <a name="M000232"></a><b>passenger_tmpdir</b>(create = true)
211
- </div>
212
- <div class="description">
213
- <p>
214
- Returns the directory in which to store Phusion Passenger-specific
215
- temporary files. If <tt>create</tt> is true, then this method creates the
216
- directory if it doesn&#8216;t exist.
217
- </p>
218
- </div>
219
- <div class="sourcecode">
220
- <p class="source-link">[ <a href="javascript:toggleSource('M000232_source')" id="l_M000232_source">show source</a> ]</p>
221
- <div id="M000232_source" class="dyn-source">
222
- <pre>
223
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils/tmpdir.rb, line 37</span>
224
- 37: <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>)
225
- 38: <span class="ruby-identifier">dir</span> = <span class="ruby-ivar">@@passenger_tmpdir</span>
226
- 39: <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>
227
- 40: <span class="ruby-identifier">tmpdir</span> = <span class="ruby-value str">&quot;/tmp&quot;</span>
228
- 41: [<span class="ruby-value str">&quot;PASSENGER_TEMP_DIR&quot;</span>, <span class="ruby-value str">&quot;PASSENGER_TMPDIR&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
229
- 42: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">empty?</span>
230
- 43: <span class="ruby-identifier">tmpdir</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>]
231
- 44: <span class="ruby-keyword kw">break</span>
232
- 45: <span class="ruby-keyword kw">end</span>
233
- 46: <span class="ruby-keyword kw">end</span>
234
- 47: <span class="ruby-identifier">dir</span> = <span class="ruby-node">&quot;#{tmpdir}/passenger.1.0.#{Process.pid}&quot;</span>
235
- 48: <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">%r{//+}</span>, <span class="ruby-value str">'/'</span>)
236
- 49: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
237
- 50: <span class="ruby-keyword kw">end</span>
238
- 51: <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>)
239
- 52: <span class="ruby-comment cmt"># This is a very minimal implementation of the subdirectory</span>
240
- 53: <span class="ruby-comment cmt"># creation logic in ServerInstanceDir.h. This implementation</span>
241
- 54: <span class="ruby-comment cmt"># is only meant to make the unit tests pass. For production</span>
242
- 55: <span class="ruby-comment cmt"># systems one should pre-create the temp directory with</span>
243
- 56: <span class="ruby-comment cmt"># ServerInstanceDir.h.</span>
244
- 57: <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=rwxs,g=rwx,o=rwx&quot;</span>, <span class="ruby-identifier">dir</span>)
245
- 58: <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=rwxs,g=rwx,o=rwx&quot;</span>, <span class="ruby-node">&quot;#{dir}/generation-0&quot;</span>)
246
- 59: <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=rwxs,g=rwx,o=rwx&quot;</span>, <span class="ruby-node">&quot;#{dir}/backends&quot;</span>)
247
- 60: <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=rwxs,g=rwx,o=rwx&quot;</span>, <span class="ruby-node">&quot;#{dir}/spawn-server&quot;</span>)
248
- 61: <span class="ruby-keyword kw">end</span>
249
- 62: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">dir</span>
250
- 63: <span class="ruby-keyword kw">end</span>
251
- </pre>
252
- </div>
253
- </div>
254
- </div>
255
- <div class="method">
256
- <div class="title">
257
- <a name="M000233"></a><b>passenger_tmpdir=</b>(dir)
258
- </div>
259
- <div class="sourcecode">
260
- <p class="source-link">[ <a href="javascript:toggleSource('M000233_source')" id="l_M000233_source">show source</a> ]</p>
261
- <div id="M000233_source" class="dyn-source">
262
- <pre>
263
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils/tmpdir.rb, line 65</span>
264
- 65: <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>)
265
- 66: <span class="ruby-ivar">@@passenger_tmpdir</span> = <span class="ruby-identifier">dir</span>
266
- 67: <span class="ruby-keyword kw">end</span>
267
- </pre>
268
- </div>
269
- </div>
270
- </div>
271
- <div class="sectiontitle">Protected Instance methods</div>
272
- <div class="method">
273
- <div class="title">
274
- <a name="M000213"></a><b>after_handling_requests</b>()
275
- </div>
276
- <div class="description">
277
- <p>
278
- To be called after the request handler main loop is exited. This function
279
- will fire off necessary events perform necessary cleanup tasks.
280
- </p>
281
- </div>
282
- <div class="sourcecode">
283
- <p class="source-link">[ <a href="javascript:toggleSource('M000213_source')" id="l_M000213_source">show source</a> ]</p>
284
- <div id="M000213_source" class="dyn-source">
285
- <pre>
286
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 420</span>
287
- 420: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_handling_requests</span>
288
- 421: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">call_event</span>(<span class="ruby-identifier">:stopping_worker_process</span>)
289
- 422: <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">passenger_call_at_exit_blocks</span>
290
- 423: <span class="ruby-keyword kw">end</span>
291
- </pre>
292
- </div>
293
- </div>
294
- </div>
295
- <div class="method">
296
- <div class="title">
297
- <a name="M000211"></a><b>after_loading_app_code</b>(options)
298
- </div>
299
- <div class="description">
300
- <p>
301
- This method is to be called after loading the application code but before
302
- forking a worker process.
303
- </p>
304
- </div>
305
- <div class="sourcecode">
306
- <p class="source-link">[ <a href="javascript:toggleSource('M000211_source')" id="l_M000211_source">show source</a> ]</p>
307
- <div id="M000211_source" class="dyn-source">
308
- <pre>
309
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 357</span>
310
- 357: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_loading_app_code</span>(<span class="ruby-identifier">options</span>)
311
- 358: <span class="ruby-comment cmt"># Even though prepare_app_process() restores the Phusion Passenger</span>
312
- 359: <span class="ruby-comment cmt"># load path after setting up Bundler, the app itself might also</span>
313
- 360: <span class="ruby-comment cmt"># remove Phusion Passenger from the load path for whatever reason,</span>
314
- 361: <span class="ruby-comment cmt"># so here we restore the load path again.</span>
315
- 362: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">LIBDIR</span>
316
- 363: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-constant">LIBDIR</span>)
317
- 364: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">uniq!</span>
318
- 365: <span class="ruby-keyword kw">end</span>
319
- 366:
320
- 367: <span class="ruby-comment cmt"># Post-install framework extensions. Possibly preceded by a call to</span>
321
- 368: <span class="ruby-comment cmt"># PhusionPassenger.install_framework_extensions!</span>
322
- 369: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rails/version'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>)
323
- 370: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Rails</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span><span class="ruby-operator">::</span><span class="ruby-constant">MAJOR</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">2</span>
324
- 371: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/classic_rails_extensions/init'</span>
325
- 372: <span class="ruby-constant">ClassicRailsExtensions</span>.<span class="ruby-identifier">init!</span>(<span class="ruby-identifier">options</span>)
326
- 373: <span class="ruby-comment cmt"># Rails 3 extensions are installed by</span>
327
- 374: <span class="ruby-comment cmt"># PhusionPassenger.install_framework_extensions!</span>
328
- 375: <span class="ruby-keyword kw">end</span>
329
- 376:
330
- 377: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">_spawn_options</span> = <span class="ruby-keyword kw">nil</span>
331
- 378: <span class="ruby-keyword kw">end</span>
332
- </pre>
333
- </div>
334
- </div>
335
- </div>
336
- <div class="method">
337
- <div class="title">
338
- <a name="M000200"></a><b>assert_valid_directory</b>(path)
339
- </div>
340
- <div class="description">
341
- <p>
342
- Assert that <tt>path</tt> is a directory. Raises <tt><a
343
- href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
344
- </p>
345
- </div>
346
- <div class="sourcecode">
347
- <p class="source-link">[ <a href="javascript:toggleSource('M000200_source')" id="l_M000200_source">show source</a> ]</p>
348
- <div id="M000200_source" class="dyn-source">
349
- <pre>
350
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 64</span>
351
- 64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_directory</span>(<span class="ruby-identifier">path</span>)
352
- 65: <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>)
353
- 66: <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>
354
- 67: <span class="ruby-keyword kw">end</span>
355
- 68: <span class="ruby-keyword kw">end</span>
356
- </pre>
357
- </div>
358
- </div>
359
- </div>
360
- <div class="method">
361
- <div class="title">
362
- <a name="M000201"></a><b>assert_valid_file</b>(path)
363
- </div>
364
- <div class="description">
365
- <p>
366
- Assert that <tt>path</tt> is a file. Raises <tt><a
367
- href="InvalidPath.html">InvalidPath</a></tt> if it isn&#8216;t.
368
- </p>
369
- </div>
370
- <div class="sourcecode">
371
- <p class="source-link">[ <a href="javascript:toggleSource('M000201_source')" id="l_M000201_source">show source</a> ]</p>
372
- <div id="M000201_source" class="dyn-source">
373
- <pre>
374
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 71</span>
375
- 71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_file</span>(<span class="ruby-identifier">path</span>)
376
- 72: <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>)
377
- 73: <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>
378
- 74: <span class="ruby-keyword kw">end</span>
379
- 75: <span class="ruby-keyword kw">end</span>
380
- </pre>
381
- </div>
382
- </div>
383
- </div>
384
- <div class="method">
385
- <div class="title">
386
- <a name="M000203"></a><b>assert_valid_groupname</b>(groupname)
387
- </div>
388
- <div class="description">
389
- <p>
390
- Assert that <tt>groupname</tt> is a valid group name. Raises ArgumentError
391
- if that is not the case.
392
- </p>
393
- </div>
394
- <div class="sourcecode">
395
- <p class="source-link">[ <a href="javascript:toggleSource('M000203_source')" id="l_M000203_source">show source</a> ]</p>
396
- <div id="M000203_source" class="dyn-source">
397
- <pre>
398
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 86</span>
399
- 86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_groupname</span>(<span class="ruby-identifier">groupname</span>)
400
- 87: <span class="ruby-comment cmt"># If groupname does not exist then getgrnam() will raise an ArgumentError.</span>
401
- 88: <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>)
402
- 89: <span class="ruby-keyword kw">end</span>
403
- </pre>
404
- </div>
405
- </div>
406
- </div>
407
- <div class="method">
408
- <div class="title">
409
- <a name="M000202"></a><b>assert_valid_username</b>(username)
410
- </div>
411
- <div class="description">
412
- <p>
413
- Assert that <tt>username</tt> is a valid username. Raises ArgumentError if
414
- that is not the case.
415
- </p>
416
- </div>
417
- <div class="sourcecode">
418
- <p class="source-link">[ <a href="javascript:toggleSource('M000202_source')" id="l_M000202_source">show source</a> ]</p>
419
- <div id="M000202_source" class="dyn-source">
420
- <pre>
421
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 79</span>
422
- 79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_valid_username</span>(<span class="ruby-identifier">username</span>)
423
- 80: <span class="ruby-comment cmt"># If username does not exist then getpwnam() will raise an ArgumentError.</span>
424
- 81: <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>)
425
- 82: <span class="ruby-keyword kw">end</span>
426
- </pre>
427
- </div>
428
- </div>
429
- </div>
430
- <div class="method">
431
- <div class="title">
432
- <a name="M000210"></a><b>at_exit</b>(&amp;block)
433
- </div>
434
- <div class="sourcecode">
435
- <p class="source-link">[ <a href="javascript:toggleSource('M000210_source')" id="l_M000210_source">show source</a> ]</p>
436
- <div id="M000210_source" class="dyn-source">
437
- <pre>
438
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 267</span>
439
- 267: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_exit</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
440
- 268: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">passenger_at_exit</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
441
- 269: <span class="ruby-keyword kw">end</span>
442
- </pre>
443
- </div>
444
- </div>
445
- </div>
446
- <div class="method">
447
- <div class="title">
448
- <a name="M000212"></a><b>before_handling_requests</b>(forked, options)
449
- </div>
450
- <div class="description">
451
- <p>
452
- To be called before the request handler main loop is entered, but after the
453
- app startup file has been loaded. This function will fire off necessary
454
- events and perform necessary preparation tasks.
455
- </p>
456
- <p>
457
- <tt>forked</tt> indicates whether the current worker process is forked off
458
- from an ApplicationSpawner that has preloaded the app code.
459
- <tt>options</tt> are the spawn options that were passed.
460
- </p>
461
- </div>
462
- <div class="sourcecode">
463
- <p class="source-link">[ <a href="javascript:toggleSource('M000212_source')" id="l_M000212_source">show source</a> ]</p>
464
- <div id="M000212_source" class="dyn-source">
465
- <pre>
466
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 387</span>
467
- 387: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_handling_requests</span>(<span class="ruby-identifier">forked</span>, <span class="ruby-identifier">options</span>)
468
- 388: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forked</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;analytics_logger&quot;</span>]
469
- 389: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;analytics_logger&quot;</span>].<span class="ruby-identifier">clear_connection</span>
470
- 390: <span class="ruby-keyword kw">end</span>
471
- 391:
472
- 392: <span class="ruby-comment cmt"># If we were forked from a preloader process then clear or</span>
473
- 393: <span class="ruby-comment cmt"># re-establish ActiveRecord database connections. This prevents</span>
474
- 394: <span class="ruby-comment cmt"># child processes from concurrently accessing the same</span>
475
- 395: <span class="ruby-comment cmt"># database connection handles.</span>
476
- 396: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forked</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>)
477
- 397: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:clear_all_connections!</span>)
478
- 398: <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">clear_all_connections!</span>
479
- 399: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:clear_active_connections!</span>)
480
- 400: <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">clear_active_connections!</span>
481
- 401: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:connected?</span>) <span class="ruby-operator">&amp;&amp;</span>
482
- 402: <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">connected?</span>
483
- 403: <span class="ruby-operator">::</span><span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">establish_connection</span>
484
- 404: <span class="ruby-keyword kw">end</span>
485
- 405: <span class="ruby-keyword kw">end</span>
486
- 406:
487
- 407: <span class="ruby-comment cmt"># Fire off events.</span>
488
- 408: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">call_event</span>(<span class="ruby-identifier">:starting_worker_process</span>, <span class="ruby-identifier">forked</span>)
489
- 409: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;pool_account_username&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;pool_account_password_base64&quot;</span>]
490
- 410: <span class="ruby-identifier">password</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;pool_account_password_base64&quot;</span>].<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'m'</span>).<span class="ruby-identifier">first</span>
491
- 411: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">call_event</span>(<span class="ruby-identifier">:credentials</span>,
492
- 412: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;pool_account_username&quot;</span>], <span class="ruby-identifier">password</span>)
493
- 413: <span class="ruby-keyword kw">else</span>
494
- 414: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">call_event</span>(<span class="ruby-identifier">:credentials</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
495
- 415: <span class="ruby-keyword kw">end</span>
496
- 416: <span class="ruby-keyword kw">end</span>
497
- </pre>
498
- </div>
499
- </div>
500
- </div>
501
- <div class="method">
502
- <div class="title">
503
- <a name="M000199"></a><b>canonicalize_path</b>(path)
504
- </div>
505
- <div class="description">
506
- <p>
507
- Return the canonicalized version of <tt>path</tt>. This path is guaranteed
508
- to to be &quot;normal&quot;, i.e. it doesn&#8216;t contain stuff like
509
- &quot;..&quot; or &quot;/&quot;, and it fully resolves symbolic links.
510
- </p>
511
- <p>
512
- Raises SystemCallError if something went wrong. Raises ArgumentError if
513
- <tt>path</tt> is nil. Raises <a href="InvalidPath.html">InvalidPath</a> if
514
- <tt>path</tt> does not appear to be a valid path.
515
- </p>
516
- </div>
517
- <div class="sourcecode">
518
- <p class="source-link">[ <a href="javascript:toggleSource('M000199_source')" id="l_M000199_source">show source</a> ]</p>
519
- <div id="M000199_source" class="dyn-source">
520
- <pre>
521
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 56</span>
522
- 56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-identifier">path</span>)
523
- 57: <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>
524
- 58: <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>
525
- 59: <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>
526
- 60: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPath</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
527
- 61: <span class="ruby-keyword kw">end</span>
528
- </pre>
529
- </div>
530
- </div>
531
- </div>
532
- <div class="method">
533
- <div class="title">
534
- <a name="M000223"></a><b>check_directory_tree_permissions</b>(dir)
535
- </div>
536
- <div class="description">
537
- <p>
538
- Checks the permissions of all parent directories of <tt>dir</tt> as well as
539
- <tt>dir</tt> itself.
540
- </p>
541
- <p>
542
- <tt>dir</tt> must be a canonical path.
543
- </p>
544
- <p>
545
- If one of the parent directories has wrong permissions, causing
546
- <tt>dir</tt> to be inaccessible by the current process, then this function
547
- returns [path, true] where <tt>path</tt> is the path of the top-most
548
- directory with wrong permissions.
549
- </p>
550
- <p>
551
- If <tt>dir</tt> itself is not executable by the current process then this
552
- function returns [dir, false].
553
- </p>
554
- <p>
555
- Otherwise, nil is returned.
556
- </p>
557
- </div>
558
- <div class="sourcecode">
559
- <p class="source-link">[ <a href="javascript:toggleSource('M000223_source')" id="l_M000223_source">show source</a> ]</p>
560
- <div id="M000223_source" class="dyn-source">
561
- <pre>
562
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 757</span>
563
- 757: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_directory_tree_permissions</span>(<span class="ruby-identifier">dir</span>)
564
- 758: <span class="ruby-identifier">components</span> = <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;/&quot;</span>)
565
- 759: <span class="ruby-identifier">components</span>.<span class="ruby-identifier">shift</span>
566
- 760: <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
567
- 761: <span class="ruby-comment cmt"># We can't use File.readable() and friends here because they</span>
568
- 762: <span class="ruby-comment cmt"># don't always work right with ACLs. Instead of we use 'real'</span>
569
- 763: <span class="ruby-comment cmt"># checks.</span>
570
- 764: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">components</span>.<span class="ruby-identifier">size</span>
571
- 765: <span class="ruby-identifier">path</span> = <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">components</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">i</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/&quot;</span>)
572
- 766: <span class="ruby-keyword kw">begin</span>
573
- 767: <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">path</span>)
574
- 768: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EACCES</span>
575
- 769: <span class="ruby-keyword kw">return</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">path</span>), <span class="ruby-keyword kw">true</span>]
576
- 770: <span class="ruby-keyword kw">end</span>
577
- 771: <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
578
- 772: <span class="ruby-keyword kw">end</span>
579
- 773: <span class="ruby-keyword kw">begin</span>
580
- 774: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword kw">do</span>
581
- 775: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
582
- 776: <span class="ruby-keyword kw">end</span>
583
- 777: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EACCES</span>
584
- 778: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">dir</span>, <span class="ruby-keyword kw">false</span>]
585
- 779: <span class="ruby-keyword kw">end</span>
586
- 780: <span class="ruby-keyword kw">end</span>
587
- </pre>
588
- </div>
589
- </div>
590
- </div>
591
- <div class="method">
592
- <div class="title">
593
- <a name="M000205"></a><b>close_all_io_objects_for_fds</b>(file_descriptors_to_leave_open)
594
- </div>
595
- <div class="sourcecode">
596
- <p class="source-link">[ <a href="javascript:toggleSource('M000205_source')" id="l_M000205_source">show source</a> ]</p>
597
- <div id="M000205_source" class="dyn-source">
598
- <pre>
599
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 109</span>
600
- 109: <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>)
601
- 110: <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>
602
- 111: <span class="ruby-keyword kw">begin</span>
603
- 112: <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>
604
- 113: <span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>
605
- 114: <span class="ruby-keyword kw">end</span>
606
- 115: <span class="ruby-keyword kw">rescue</span>
607
- 116: <span class="ruby-keyword kw">end</span>
608
- 117: <span class="ruby-keyword kw">end</span>
609
- 118: <span class="ruby-keyword kw">end</span>
610
- </pre>
611
- </div>
612
- </div>
613
- </div>
614
- <div class="method">
615
- <div class="title">
616
- <a name="M000215"></a><b>connect_to_server</b>(address)
617
- </div>
618
- <div class="sourcecode">
619
- <p class="source-link">[ <a href="javascript:toggleSource('M000215_source')" id="l_M000215_source">show source</a> ]</p>
620
- <div id="M000215_source" class="dyn-source">
621
- <pre>
622
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 435</span>
623
- 435: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connect_to_server</span>(<span class="ruby-identifier">address</span>)
624
- 436: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">get_socket_address_type</span>(<span class="ruby-identifier">address</span>)
625
- 437: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:unix</span>
626
- 438: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">address</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^unix:/</span>, <span class="ruby-value str">''</span>))
627
- 439: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:tcp</span>
628
- 440: <span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span> = <span class="ruby-identifier">address</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">%r{^tcp://}</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>, <span class="ruby-value">2</span>)
629
- 441: <span class="ruby-identifier">port</span> = <span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_i</span>
630
- 442: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">TCPSocket</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
631
- 443: <span class="ruby-keyword kw">else</span>
632
- 444: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown socket address type for '#{address}'.&quot;</span>
633
- 445: <span class="ruby-keyword kw">end</span>
634
- 446: <span class="ruby-keyword kw">end</span>
635
- </pre>
636
- </div>
637
- </div>
638
- </div>
639
- <div class="method">
640
- <div class="title">
641
- <a name="M000204"></a><b>generate_random_id</b>(method)
642
- </div>
643
- <div class="description">
644
- <p>
645
- Generate a long, cryptographically secure random ID string, which is also a
646
- valid filename.
647
- </p>
648
- </div>
649
- <div class="sourcecode">
650
- <p class="source-link">[ <a href="javascript:toggleSource('M000204_source')" id="l_M000204_source">show source</a> ]</p>
651
- <div id="M000204_source" class="dyn-source">
652
- <pre>
653
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 93</span>
654
- 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate_random_id</span>(<span class="ruby-identifier">method</span>)
655
- 94: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">method</span>
656
- 95: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:base64</span>
657
- 96: <span class="ruby-identifier">data</span> = [<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">&quot;/dev/urandom&quot;</span>, <span class="ruby-value">64</span>)].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'m'</span>)
658
- 97: <span class="ruby-identifier">data</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">&quot;\n&quot;</span>, <span class="ruby-value str">''</span>)
659
- 98: <span class="ruby-identifier">data</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">&quot;+&quot;</span>, <span class="ruby-value str">''</span>)
660
- 99: <span class="ruby-identifier">data</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">&quot;/&quot;</span>, <span class="ruby-value str">''</span>)
661
- 100: <span class="ruby-identifier">data</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/==$/</span>, <span class="ruby-value str">''</span>)
662
- 101: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">data</span>
663
- 102: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:hex</span>
664
- 103: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">&quot;/dev/urandom&quot;</span>, <span class="ruby-value">64</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'H*'</span>)[<span class="ruby-value">0</span>]
665
- 104: <span class="ruby-keyword kw">else</span>
666
- 105: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Invalid method #{method.inspect}&quot;</span>
667
- 106: <span class="ruby-keyword kw">end</span>
668
- 107: <span class="ruby-keyword kw">end</span>
669
- </pre>
670
- </div>
671
- </div>
672
- </div>
673
- <div class="method">
674
- <div class="title">
675
- <a name="M000214"></a><b>get_socket_address_type</b>(address)
676
- </div>
677
- <div class="sourcecode">
678
- <p class="source-link">[ <a href="javascript:toggleSource('M000214_source')" id="l_M000214_source">show source</a> ]</p>
679
- <div id="M000214_source" class="dyn-source">
680
- <pre>
681
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 425</span>
682
- 425: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_socket_address_type</span>(<span class="ruby-identifier">address</span>)
683
- 426: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">address</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{^unix:.}</span>
684
- 427: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:unix</span>
685
- 428: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">address</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{^tcp://.}</span>
686
- 429: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:tcp</span>
687
- 430: <span class="ruby-keyword kw">else</span>
688
- 431: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">:unknown</span>
689
- 432: <span class="ruby-keyword kw">end</span>
690
- 433: <span class="ruby-keyword kw">end</span>
691
- </pre>
692
- </div>
693
- </div>
694
- </div>
695
- <div class="method">
696
- <div class="title">
697
- <a name="M000224"></a><b>global_backtrace_report</b>()
698
- </div>
699
- <div class="description">
700
- <p>
701
- Returns a string which reports the backtraces for all threads, or if
702
- that&#8216;s not supported the backtrace for the current thread.
703
- </p>
704
- </div>
705
- <div class="sourcecode">
706
- <p class="source-link">[ <a href="javascript:toggleSource('M000224_source')" id="l_M000224_source">show source</a> ]</p>
707
- <div id="M000224_source" class="dyn-source">
708
- <pre>
709
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 784</span>
710
- 784: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global_backtrace_report</span>
711
- 785: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:caller_for_all_threads</span>)
712
- 786: <span class="ruby-identifier">output</span> = <span class="ruby-node">&quot;========== Process #{Process.pid}: backtrace dump ==========\n&quot;</span>
713
- 787: <span class="ruby-identifier">caller_for_all_threads</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">thread</span>, <span class="ruby-identifier">stack</span><span class="ruby-operator">|</span>
714
- 788: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
715
- 789: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;# Thread: #{thread.inspect}, &quot;</span>
716
- 790: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">thread</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">main</span>
717
- 791: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;[main thread], &quot;</span>
718
- 792: <span class="ruby-keyword kw">end</span>
719
- 793: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">thread</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
720
- 794: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;[current thread], &quot;</span>
721
- 795: <span class="ruby-keyword kw">end</span>
722
- 796: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;alive = #{thread.alive?}\n&quot;</span>
723
- 797: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
724
- 798: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n &quot;</span>)
725
- 799: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\n&quot;</span>
726
- 800: <span class="ruby-keyword kw">end</span>
727
- 801: <span class="ruby-keyword kw">else</span>
728
- 802: <span class="ruby-identifier">output</span> = <span class="ruby-node">&quot;========== Process #{Process.pid}: backtrace dump ==========\n&quot;</span>
729
- 803: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
730
- 804: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;# Current thread: #{Thread.current.inspect}\n&quot;</span>
731
- 805: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">&quot;-&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
732
- 806: <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n &quot;</span>)
733
- 807: <span class="ruby-keyword kw">end</span>
734
- 808: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">output</span>
735
- 809: <span class="ruby-keyword kw">end</span>
736
- </pre>
737
- </div>
738
- </div>
739
- </div>
740
- <div class="method">
741
- <div class="title">
742
- <a name="M000216"></a><b>local_socket_address?</b>(address)
743
- </div>
744
- <div class="sourcecode">
745
- <p class="source-link">[ <a href="javascript:toggleSource('M000216_source')" id="l_M000216_source">show source</a> ]</p>
746
- <div id="M000216_source" class="dyn-source">
747
- <pre>
748
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 448</span>
749
- 448: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">local_socket_address?</span>(<span class="ruby-identifier">address</span>)
750
- 449: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">get_socket_address_type</span>(<span class="ruby-identifier">address</span>)
751
- 450: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:unix</span>
752
- 451: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
753
- 452: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:tcp</span>
754
- 453: <span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span> = <span class="ruby-identifier">address</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">%r{^tcp://}</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>, <span class="ruby-value">2</span>)
755
- 454: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;127.0.0.1&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;::1&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;localhost&quot;</span>
756
- 455: <span class="ruby-keyword kw">else</span>
757
- 456: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown socket address type for '#{address}'.&quot;</span>
758
- 457: <span class="ruby-keyword kw">end</span>
759
- 458: <span class="ruby-keyword kw">end</span>
760
- </pre>
761
- </div>
762
- </div>
763
- </div>
764
- <div class="method">
765
- <div class="title">
766
- <a name="M000222"></a><b>lower_privilege</b>(startup_file, options)
767
- </div>
768
- <div class="description">
769
- <p>
770
- Lowers the current process&#8216;s privilege based on the documented rules
771
- for the &quot;user&quot;, &quot;group&quot;, &quot;default_user&quot; and
772
- &quot;default_group&quot; options.
773
- </p>
774
- </div>
775
- <div class="sourcecode">
776
- <p class="source-link">[ <a href="javascript:toggleSource('M000222_source')" id="l_M000222_source">show source</a> ]</p>
777
- <div id="M000222_source" class="dyn-source">
778
- <pre>
779
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 662</span>
780
- 662: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lower_privilege</span>(<span class="ruby-identifier">startup_file</span>, <span class="ruby-identifier">options</span>)
781
- 663: <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">lower_privilege_called</span>
782
- 664: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">euid</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
783
- 665:
784
- 666: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_user&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_user&quot;</span>].<span class="ruby-identifier">empty?</span>
785
- 667: <span class="ruby-identifier">default_user</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_user&quot;</span>]
786
- 668: <span class="ruby-keyword kw">else</span>
787
- 669: <span class="ruby-identifier">default_user</span> = <span class="ruby-value str">&quot;nobody&quot;</span>
788
- 670: <span class="ruby-keyword kw">end</span>
789
- 671: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_group&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_group&quot;</span>].<span class="ruby-identifier">empty?</span>
790
- 672: <span class="ruby-identifier">default_group</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;default_group&quot;</span>]
791
- 673: <span class="ruby-keyword kw">else</span>
792
- 674: <span class="ruby-identifier">default_group</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrgid</span>(<span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">default_user</span>).<span class="ruby-identifier">gid</span>).<span class="ruby-identifier">name</span>
793
- 675: <span class="ruby-keyword kw">end</span>
794
- 676:
795
- 677: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;user&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;user&quot;</span>].<span class="ruby-identifier">empty?</span>
796
- 678: <span class="ruby-keyword kw">begin</span>
797
- 679: <span class="ruby-identifier">user_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;user&quot;</span>])
798
- 680: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
799
- 681: <span class="ruby-identifier">user_info</span> = <span class="ruby-keyword kw">nil</span>
800
- 682: <span class="ruby-keyword kw">end</span>
801
- 683: <span class="ruby-keyword kw">else</span>
802
- 684: <span class="ruby-identifier">uid</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">lstat</span>(<span class="ruby-identifier">startup_file</span>).<span class="ruby-identifier">uid</span>
803
- 685: <span class="ruby-keyword kw">begin</span>
804
- 686: <span class="ruby-identifier">user_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-identifier">uid</span>)
805
- 687: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
806
- 688: <span class="ruby-identifier">user_info</span> = <span class="ruby-keyword kw">nil</span>
807
- 689: <span class="ruby-keyword kw">end</span>
808
- 690: <span class="ruby-keyword kw">end</span>
809
- 691: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">user_info</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
810
- 692: <span class="ruby-keyword kw">begin</span>
811
- 693: <span class="ruby-identifier">user_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwnam</span>(<span class="ruby-identifier">default_user</span>)
812
- 694: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
813
- 695: <span class="ruby-identifier">user_info</span> = <span class="ruby-keyword kw">nil</span>
814
- 696: <span class="ruby-keyword kw">end</span>
815
- 697: <span class="ruby-keyword kw">end</span>
816
- 698:
817
- 699: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;group&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;group&quot;</span>].<span class="ruby-identifier">empty?</span>
818
- 700: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;group&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;!STARTUP_FILE!&quot;</span>
819
- 701: <span class="ruby-identifier">gid</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">lstat</span>(<span class="ruby-identifier">startup_file</span>).<span class="ruby-identifier">gid</span>
820
- 702: <span class="ruby-keyword kw">begin</span>
821
- 703: <span class="ruby-identifier">group_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrgid</span>(<span class="ruby-identifier">gid</span>)
822
- 704: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
823
- 705: <span class="ruby-identifier">group_info</span> = <span class="ruby-keyword kw">nil</span>
824
- 706: <span class="ruby-keyword kw">end</span>
825
- 707: <span class="ruby-keyword kw">else</span>
826
- 708: <span class="ruby-keyword kw">begin</span>
827
- 709: <span class="ruby-identifier">group_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrnam</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;group&quot;</span>])
828
- 710: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
829
- 711: <span class="ruby-identifier">group_info</span> = <span class="ruby-keyword kw">nil</span>
830
- 712: <span class="ruby-keyword kw">end</span>
831
- 713: <span class="ruby-keyword kw">end</span>
832
- 714: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">user_info</span>
833
- 715: <span class="ruby-keyword kw">begin</span>
834
- 716: <span class="ruby-identifier">group_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrgid</span>(<span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">gid</span>)
835
- 717: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
836
- 718: <span class="ruby-identifier">group_info</span> = <span class="ruby-keyword kw">nil</span>
837
- 719: <span class="ruby-keyword kw">end</span>
838
- 720: <span class="ruby-keyword kw">else</span>
839
- 721: <span class="ruby-identifier">group_info</span> = <span class="ruby-keyword kw">nil</span>
840
- 722: <span class="ruby-keyword kw">end</span>
841
- 723: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">group_info</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">group_info</span>.<span class="ruby-identifier">gid</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
842
- 724: <span class="ruby-keyword kw">begin</span>
843
- 725: <span class="ruby-identifier">group_info</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrnam</span>(<span class="ruby-identifier">default_group</span>)
844
- 726: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>
845
- 727: <span class="ruby-identifier">group_info</span> = <span class="ruby-keyword kw">nil</span>
846
- 728: <span class="ruby-keyword kw">end</span>
847
- 729: <span class="ruby-keyword kw">end</span>
848
- 730:
849
- 731: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">user_info</span>
850
- 732: <span class="ruby-identifier">raise</span> <span class="ruby-constant">SecurityError</span>, <span class="ruby-value str">&quot;Cannot determine a user to lower privilege to&quot;</span>
851
- 733: <span class="ruby-keyword kw">end</span>
852
- 734: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">group_info</span>
853
- 735: <span class="ruby-identifier">raise</span> <span class="ruby-constant">SecurityError</span>, <span class="ruby-value str">&quot;Cannot determine a group to lower privilege to&quot;</span>
854
- 736: <span class="ruby-keyword kw">end</span>
855
- 737:
856
- 738: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">switch_user</span>(<span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">uid</span>, <span class="ruby-identifier">group_info</span>.<span class="ruby-identifier">gid</span>)
857
- 739: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'USER'</span>] = <span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">name</span>
858
- 740: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HOME'</span>] = <span class="ruby-identifier">user_info</span>.<span class="ruby-identifier">dir</span>
859
- 741: <span class="ruby-keyword kw">end</span>
860
- </pre>
861
- </div>
862
- </div>
863
- </div>
864
- <div class="method">
865
- <div class="title">
866
- <a name="M000206"></a><b>marshal_exception</b>(exception)
867
- </div>
868
- <div class="sourcecode">
869
- <p class="source-link">[ <a href="javascript:toggleSource('M000206_source')" id="l_M000206_source">show source</a> ]</p>
870
- <div id="M000206_source" class="dyn-source">
871
- <pre>
872
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 120</span>
873
- 120: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">marshal_exception</span>(<span class="ruby-identifier">exception</span>)
874
- 121: <span class="ruby-identifier">data</span> = {
875
- 122: <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>,
876
- 123: <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>,
877
- 124: <span class="ruby-identifier">:backtrace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>
878
- 125: }
879
- 126: <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>)
880
- 127: <span class="ruby-identifier">data</span>[<span class="ruby-identifier">:is_initialization_error</span>] = <span class="ruby-keyword kw">true</span>
881
- 128: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>
882
- 129: <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>)
883
- 130: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span>
884
- 131: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>
885
- 132: <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>)
886
- 133: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">child_exception</span>
887
- 134: <span class="ruby-keyword kw">end</span>
888
- 135: <span class="ruby-keyword kw">else</span>
889
- 136: <span class="ruby-keyword kw">begin</span>
890
- 137: <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>)
891
- 138: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
892
- 139: <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>,
893
- 140: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace</span>)
894
- 141: <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>)
895
- 142: <span class="ruby-keyword kw">end</span>
896
- 143: <span class="ruby-keyword kw">end</span>
897
- 144: <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>)
898
- 145: <span class="ruby-keyword kw">end</span>
899
- </pre>
900
- </div>
901
- </div>
902
- </div>
903
- <div class="method">
904
- <div class="title">
905
- <a name="M000231"></a><b>passenger_tmpdir</b>(create = true)
906
- </div>
907
- <div class="sourcecode">
908
- <p class="source-link">[ <a href="javascript:toggleSource('M000231_source')" id="l_M000231_source">show source</a> ]</p>
909
- <div id="M000231_source" class="dyn-source">
910
- <pre>
911
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils/tmpdir.rb, line 30</span>
912
- 30: <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>)
913
- 31: <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>)
914
- 32: <span class="ruby-keyword kw">end</span>
915
- </pre>
916
- </div>
917
- </div>
918
- </div>
919
- <div class="method">
920
- <div class="title">
921
- <a name="M000209"></a><b>prepare_app_process</b>(startup_file, options)
922
- </div>
923
- <div class="description">
924
- <p>
925
- Prepare an application process using rules for the given spawn options.
926
- This method is to be called before loading the application code.
927
- </p>
928
- <p>
929
- <tt>startup_file</tt> is the application type&#8216;s startup file, e.g.
930
- &quot;config/environment.rb&quot; for Rails apps and &quot;config.ru&quot;
931
- for <a href="Rack.html">Rack</a> apps. See <a
932
- href="SpawnManager.html#M000372">SpawnManager#spawn_application</a> for
933
- options.
934
- </p>
935
- <p>
936
- This function may modify <tt>options</tt>. The modified options are to be
937
- passed to the request handler.
938
- </p>
939
- </div>
940
- <div class="sourcecode">
941
- <p class="source-link">[ <a href="javascript:toggleSource('M000209_source')" id="l_M000209_source">show source</a> ]</p>
942
- <div id="M000209_source" class="dyn-source">
943
- <pre>
944
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 194</span>
945
- 194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepare_app_process</span>(<span class="ruby-identifier">startup_file</span>, <span class="ruby-identifier">options</span>)
946
- 195: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>] = <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>])
947
- 196: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>])
948
- 197:
949
- 198: <span class="ruby-identifier">lower_privilege</span>(<span class="ruby-identifier">startup_file</span>, <span class="ruby-identifier">options</span>)
950
- 199: <span class="ruby-identifier">path</span>, <span class="ruby-identifier">is_parent</span> = <span class="ruby-identifier">check_directory_tree_permissions</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>])
951
- 200: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>
952
- 201: <span class="ruby-identifier">username</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-constant">Process</span>.<span class="ruby-identifier">euid</span>).<span class="ruby-identifier">name</span>
953
- 202: <span class="ruby-identifier">groupname</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getgrgid</span>(<span class="ruby-constant">Process</span>.<span class="ruby-identifier">egid</span>).<span class="ruby-identifier">name</span>
954
- 203: <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;This application process is currently running as &quot;</span> <span class="ruby-operator">+</span>
955
- 204: <span class="ruby-node">&quot;user '#{username}' and group '#{groupname}' and must be &quot;</span> <span class="ruby-operator">+</span>
956
- 205: <span class="ruby-value str">&quot;able to access its application root directory &quot;</span> <span class="ruby-operator">+</span>
957
- 206: <span class="ruby-node">&quot;'#{options[&quot;app_root&quot;]}'. &quot;</span>
958
- 207: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_parent</span>
959
- 208: <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;However the parent directory '#{path}' &quot;</span> <span class="ruby-operator">+</span>
960
- 209: <span class="ruby-value str">&quot;has wrong permissions, thereby preventing &quot;</span> <span class="ruby-operator">+</span>
961
- 210: <span class="ruby-value str">&quot;this process from accessing its application &quot;</span> <span class="ruby-operator">+</span>
962
- 211: <span class="ruby-value str">&quot;root directory. Please fix the permissions &quot;</span> <span class="ruby-operator">+</span>
963
- 212: <span class="ruby-node">&quot;of the directory '#{path}' first.&quot;</span>
964
- 213: <span class="ruby-keyword kw">else</span>
965
- 214: <span class="ruby-identifier">message</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;However this directory is not accessible &quot;</span> <span class="ruby-operator">+</span>
966
- 215: <span class="ruby-value str">&quot;because it has wrong permissions. Please fix &quot;</span> <span class="ruby-operator">+</span>
967
- 216: <span class="ruby-value str">&quot;these permissions first.&quot;</span>
968
- 217: <span class="ruby-keyword kw">end</span>
969
- 218: <span class="ruby-identifier">raise</span>(<span class="ruby-identifier">message</span>)
970
- 219: <span class="ruby-keyword kw">end</span>
971
- 220:
972
- 221: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;RAILS_ENV&quot;</span>] = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;RACK_ENV&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;environment&quot;</span>]
973
- 222:
974
- 223: <span class="ruby-identifier">base_uri</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;base_uri&quot;</span>]
975
- 224: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">base_uri</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;/&quot;</span>
976
- 225: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;RAILS_RELATIVE_URL_ROOT&quot;</span>] = <span class="ruby-identifier">base_uri</span>
977
- 226: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;RACK_BASE_URI&quot;</span>] = <span class="ruby-identifier">base_uri</span>
978
- 227: <span class="ruby-keyword kw">end</span>
979
- 228:
980
- 229: <span class="ruby-identifier">encoded_environment_variables</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;environment_variables&quot;</span>]
981
- 230: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">encoded_environment_variables</span>
982
- 231: <span class="ruby-identifier">env_vars_string</span> = <span class="ruby-identifier">encoded_environment_variables</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;m&quot;</span>).<span class="ruby-identifier">first</span>
983
- 232: <span class="ruby-identifier">env_vars_array</span> = <span class="ruby-identifier">env_vars_string</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\0&quot;</span>, <span class="ruby-value">-1</span>)
984
- 233: <span class="ruby-identifier">env_vars_array</span>.<span class="ruby-identifier">pop</span>
985
- 234: <span class="ruby-identifier">env_vars</span> = <span class="ruby-constant">Hash</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">env_vars_array</span>]
986
- 235: <span class="ruby-identifier">env_vars</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
987
- 236: <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
988
- 237: <span class="ruby-keyword kw">end</span>
989
- 238: <span class="ruby-keyword kw">end</span>
990
- 239:
991
- 240: <span class="ruby-comment cmt"># Instantiate the analytics logger if requested. Can be nil.</span>
992
- 241: <span class="ruby-identifier">require</span> <span class="ruby-value str">'phusion_passenger/analytics_logger'</span>
993
- 242: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;analytics_logger&quot;</span>] = <span class="ruby-constant">AnalyticsLogger</span>.<span class="ruby-identifier">new_from_options</span>(<span class="ruby-identifier">options</span>)
994
- 243:
995
- 244: <span class="ruby-comment cmt"># Make sure RubyGems uses any new environment variable values</span>
996
- 245: <span class="ruby-comment cmt"># that have been set now (e.g. $HOME, $GEM_HOME, etc) and that</span>
997
- 246: <span class="ruby-comment cmt"># it is able to detect newly installed gems.</span>
998
- 247: <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">clear_paths</span>
999
- 248:
1000
- 249: <span class="ruby-comment cmt"># Because spawned app processes exit using #exit!, #at_exit</span>
1001
- 250: <span class="ruby-comment cmt"># blocks aren't called. Here we ninja patch Kernel so that</span>
1002
- 251: <span class="ruby-comment cmt"># we can call #at_exit blocks during app process shutdown.</span>
1003
- 252: <span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Kernel</span>
1004
- 253: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passenger_call_at_exit_blocks</span>
1005
- 254: <span class="ruby-ivar">@passenger_at_exit_blocks</span> <span class="ruby-operator">||=</span> []
1006
- 255: <span class="ruby-ivar">@passenger_at_exit_blocks</span>.<span class="ruby-identifier">reverse_each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">block</span><span class="ruby-operator">|</span>
1007
- 256: <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
1008
- 257: <span class="ruby-keyword kw">end</span>
1009
- 258: <span class="ruby-keyword kw">end</span>
1010
- 259:
1011
- 260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passenger_at_exit</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1012
- 261: <span class="ruby-ivar">@passenger_at_exit_blocks</span> <span class="ruby-operator">||=</span> []
1013
- 262: <span class="ruby-ivar">@passenger_at_exit_blocks</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
1014
- 263: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">block</span>
1015
- 264: <span class="ruby-keyword kw">end</span>
1016
- 265: <span class="ruby-keyword kw">end</span>
1017
- 266: <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
1018
- 267: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_exit</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1019
- 268: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">passenger_at_exit</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1020
- 269: <span class="ruby-keyword kw">end</span>
1021
- 270: <span class="ruby-keyword kw">end</span>
1022
- 271:
1023
- 272:
1024
- 273: <span class="ruby-comment cmt"># Rack::ApplicationSpawner depends on the 'rack' library, but the app</span>
1025
- 274: <span class="ruby-comment cmt"># might want us to use a bundled version instead of a</span>
1026
- 275: <span class="ruby-comment cmt"># gem/apt-get/yum/whatever-installed version. Therefore we must setup</span>
1027
- 276: <span class="ruby-comment cmt"># the correct load paths before requiring 'rack'.</span>
1028
- 277: <span class="ruby-comment cmt">#</span>
1029
- 278: <span class="ruby-comment cmt"># The most popular tool for bundling dependencies is Bundler. Bundler</span>
1030
- 279: <span class="ruby-comment cmt"># works as follows:</span>
1031
- 280: <span class="ruby-comment cmt"># - If the bundle is locked then a file .bundle/environment.rb exists</span>
1032
- 281: <span class="ruby-comment cmt"># which will setup the load paths.</span>
1033
- 282: <span class="ruby-comment cmt"># - If the bundle is not locked then the load paths must be set up by</span>
1034
- 283: <span class="ruby-comment cmt"># calling Bundler.setup.</span>
1035
- 284: <span class="ruby-comment cmt"># - Rails 3's boot.rb automatically loads .bundle/environment.rb or</span>
1036
- 285: <span class="ruby-comment cmt"># calls Bundler.setup if that's not available.</span>
1037
- 286: <span class="ruby-comment cmt"># - Other Rack apps might not have a boot.rb but we still want to setup</span>
1038
- 287: <span class="ruby-comment cmt"># Bundler.</span>
1039
- 288: <span class="ruby-comment cmt"># - Some Rails 2 apps might have explicitly added Bundler support.</span>
1040
- 289: <span class="ruby-comment cmt"># These apps call Bundler.setup in their preinitializer.rb.</span>
1041
- 290: <span class="ruby-comment cmt">#</span>
1042
- 291: <span class="ruby-comment cmt"># So the strategy is as follows:</span>
1043
- 292:
1044
- 293: <span class="ruby-comment cmt"># Our strategy might be completely unsuitable for the app or the</span>
1045
- 294: <span class="ruby-comment cmt"># developer is using something other than Bundler, so we let the user</span>
1046
- 295: <span class="ruby-comment cmt"># manually specify a load path setup file.</span>
1047
- 296: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;load_path_setup_file&quot;</span>]
1048
- 297: <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;load_path_setup_file&quot;</span>])
1049
- 298:
1050
- 299: <span class="ruby-comment cmt"># The app developer may also override our strategy with this magic file.</span>
1051
- 300: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">'config/setup_load_paths.rb'</span>)
1052
- 301: <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'config/setup_load_paths'</span>)
1053
- 302:
1054
- 303: <span class="ruby-comment cmt"># If the Bundler lock environment file exists then load that. If it</span>
1055
- 304: <span class="ruby-comment cmt"># exists then there's a 99.9% chance that loading it is the correct</span>
1056
- 305: <span class="ruby-comment cmt"># thing to do.</span>
1057
- 306: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">'.bundle/environment.rb'</span>)
1058
- 307: <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'.bundle/environment'</span>)
1059
- 308:
1060
- 309: <span class="ruby-comment cmt"># If the Bundler environment file doesn't exist then there are two</span>
1061
- 310: <span class="ruby-comment cmt"># possibilities:</span>
1062
- 311: <span class="ruby-comment cmt"># 1. Bundler is not used, in which case we don't have to do anything.</span>
1063
- 312: <span class="ruby-comment cmt"># 2. Bundler *is* used, but the gems are not locked and we're supposed</span>
1064
- 313: <span class="ruby-comment cmt"># to call Bundler.setup.</span>
1065
- 314: <span class="ruby-comment cmt">#</span>
1066
- 315: <span class="ruby-comment cmt"># The existence of Gemfile indicates whether (2) is true:</span>
1067
- 316: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">'Gemfile'</span>)
1068
- 317: <span class="ruby-comment cmt"># In case of Rails 3, config/boot.rb already calls Bundler.setup.</span>
1069
- 318: <span class="ruby-comment cmt"># However older versions of Rails may not so loading boot.rb might</span>
1070
- 319: <span class="ruby-comment cmt"># not be the correct thing to do. To be on the safe side we</span>
1071
- 320: <span class="ruby-comment cmt"># call Bundler.setup ourselves; calling Bundler.setup twice is</span>
1072
- 321: <span class="ruby-comment cmt"># harmless. If this isn't the correct thing to do after all then</span>
1073
- 322: <span class="ruby-comment cmt"># there's always the load_path_setup_file option and</span>
1074
- 323: <span class="ruby-comment cmt"># setup_load_paths.rb.</span>
1075
- 324: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rubygems'</span>
1076
- 325: <span class="ruby-identifier">require</span> <span class="ruby-value str">'bundler'</span>
1077
- 326: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">setup</span>
1078
- 327: <span class="ruby-keyword kw">end</span>
1079
- 328:
1080
- 329: <span class="ruby-comment cmt"># Bundler might remove Phusion Passenger from the load path in its zealous</span>
1081
- 330: <span class="ruby-comment cmt"># attempt to un-require RubyGems, so here we put Phusion Passenger back</span>
1082
- 331: <span class="ruby-comment cmt"># into the load path. This must be done before loading the app's startup</span>
1083
- 332: <span class="ruby-comment cmt"># file because the app might require() Phusion Passenger files.</span>
1084
- 333: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">LIBDIR</span>
1085
- 334: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-constant">LIBDIR</span>)
1086
- 335: <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">uniq!</span>
1087
- 336: <span class="ruby-keyword kw">end</span>
1088
- 337:
1089
- 338:
1090
- 339: <span class="ruby-comment cmt"># !!! NOTE !!!</span>
1091
- 340: <span class="ruby-comment cmt"># If the app is using Bundler then any dependencies required past this</span>
1092
- 341: <span class="ruby-comment cmt"># point must be specified in the Gemfile. Like ruby-debug if debugging is on...</span>
1093
- 342:
1094
- 343: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;debugger&quot;</span>]
1095
- 344: <span class="ruby-identifier">require</span> <span class="ruby-value str">'ruby-debug'</span>
1096
- 345: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">Debugger</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:ctrl_port</span>)
1097
- 346: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Your version of ruby-debug is too old. Please upgrade to the latest version.&quot;</span>
1098
- 347: <span class="ruby-keyword kw">end</span>
1099
- 348: <span class="ruby-constant">Debugger</span>.<span class="ruby-identifier">start_remote</span>(<span class="ruby-value str">'127.0.0.1'</span>, [<span class="ruby-value">0</span>, <span class="ruby-value">0</span>])
1100
- 349: <span class="ruby-constant">Debugger</span>.<span class="ruby-identifier">start</span>
1101
- 350: <span class="ruby-keyword kw">end</span>
1102
- 351:
1103
- 352: <span class="ruby-constant">PhusionPassenger</span>.<span class="ruby-identifier">_spawn_options</span> = <span class="ruby-identifier">options</span>
1104
- 353: <span class="ruby-keyword kw">end</span>
1105
- </pre>
1106
- </div>
1107
- </div>
1108
- </div>
1109
- <div class="method">
1110
- <div class="title">
1111
- <a name="M000208"></a><b>print_exception</b>(current_location, exception, destination = nil)
1112
- </div>
1113
- <div class="description">
1114
- <p>
1115
- Print the given exception, including the stack trace, to STDERR.
1116
- </p>
1117
- <p>
1118
- <tt>current_location</tt> is a string which describes where the code is
1119
- currently at. Usually the current class name will be enough.
1120
- </p>
1121
- </div>
1122
- <div class="sourcecode">
1123
- <p class="source-link">[ <a href="javascript:toggleSource('M000208_source')" id="l_M000208_source">show source</a> ]</p>
1124
- <div id="M000208_source" class="dyn-source">
1125
- <pre>
1126
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 172</span>
1127
- 172: <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-keyword kw">nil</span>)
1128
- 173: <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>)
1129
- 174: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">backtrace_string</span>(<span class="ruby-identifier">current_location</span>)
1130
- 175: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">DebugLogging</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">DebugLogging</span>)
1131
- 176: <span class="ruby-identifier">error</span>(<span class="ruby-identifier">data</span>)
1132
- 177: <span class="ruby-keyword kw">else</span>
1133
- 178: <span class="ruby-identifier">destination</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">STDERR</span>
1134
- 179: <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">data</span>)
1135
- 180: <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>)
1136
- 181: <span class="ruby-keyword kw">end</span>
1137
- 182: <span class="ruby-keyword kw">end</span>
1138
- 183: <span class="ruby-keyword kw">end</span>
1139
- </pre>
1140
- </div>
1141
- </div>
1142
- </div>
1143
- <div class="method">
1144
- <div class="title">
1145
- <a name="M000198"></a><b>private_class_method</b>(name)
1146
- </div>
1147
- <div class="sourcecode">
1148
- <p class="source-link">[ <a href="javascript:toggleSource('M000198_source')" id="l_M000198_source">show source</a> ]</p>
1149
- <div id="M000198_source" class="dyn-source">
1150
- <pre>
1151
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 44</span>
1152
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">private_class_method</span>(<span class="ruby-identifier">name</span>)
1153
- 45: <span class="ruby-identifier">metaclass</span> = <span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>
1154
- 46: <span class="ruby-identifier">metaclass</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:private</span>, <span class="ruby-identifier">name</span>)
1155
- 47: <span class="ruby-keyword kw">end</span>
1156
- </pre>
1157
- </div>
1158
- </div>
1159
- </div>
1160
- <div class="method">
1161
- <div class="title">
1162
- <a name="M000218"></a><b>process_is_alive?</b>(pid)
1163
- </div>
1164
- <div class="description">
1165
- <p>
1166
- Checks whether the given process exists.
1167
- </p>
1168
- </div>
1169
- <div class="sourcecode">
1170
- <p class="source-link">[ <a href="javascript:toggleSource('M000218_source')" id="l_M000218_source">show source</a> ]</p>
1171
- <div id="M000218_source" class="dyn-source">
1172
- <pre>
1173
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 502</span>
1174
- 502: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_is_alive?</span>(<span class="ruby-identifier">pid</span>)
1175
- 503: <span class="ruby-keyword kw">begin</span>
1176
- 504: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">pid</span>)
1177
- 505: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
1178
- 506: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ESRCH</span>
1179
- 507: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1180
- 508: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
1181
- 509: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
1182
- 510: <span class="ruby-keyword kw">end</span>
1183
- 511: <span class="ruby-keyword kw">end</span>
1184
- </pre>
1185
- </div>
1186
- </div>
1187
- </div>
1188
- <div class="method">
1189
- <div class="title">
1190
- <a name="M000219"></a><b>report_app_init_status</b>(channel, sink = STDERR) {|| ...}
1191
- </div>
1192
- <div class="description">
1193
- <p>
1194
- Run the given block. A message will be sent through <tt>channel</tt> (a <a
1195
- href="MessageChannel.html">MessageChannel</a> object), telling the remote
1196
- side whether the block raised an exception, called exit(), or succeeded.
1197
- </p>
1198
- <p>
1199
- If <em>sink</em> is non-nil, then every operation on $stderr/STDERR inside
1200
- the block will be performed on <em>sink</em> as well. If <em>sink</em> is
1201
- nil then all operations on $stderr/STDERR inside the block will be silently
1202
- discarded, i.e. if one writes to $stderr/STDERR then nothing will be
1203
- actually written to the console.
1204
- </p>
1205
- <p>
1206
- Returns whether the block succeeded, i.e. whether it didn&#8216;t raise an
1207
- exception.
1208
- </p>
1209
- <p>
1210
- Exceptions are not propagated, except SystemExit and a few
1211
- non-StandardExeption classes such as SignalException. Of the exceptions
1212
- that are propagated, only SystemExit will be reported.
1213
- </p>
1214
- </div>
1215
- <div class="sourcecode">
1216
- <p class="source-link">[ <a href="javascript:toggleSource('M000219_source')" id="l_M000219_source">show source</a> ]</p>
1217
- <div id="M000219_source" class="dyn-source">
1218
- <pre>
1219
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 560</span>
1220
- 560: <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>)
1221
- 561: <span class="ruby-keyword kw">begin</span>
1222
- 562: <span class="ruby-identifier">old_global_stderr</span> = <span class="ruby-identifier">$stderr</span>
1223
- 563: <span class="ruby-identifier">old_stderr</span> = <span class="ruby-constant">STDERR</span>
1224
- 564: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-value str">&quot;&quot;</span>
1225
- 565:
1226
- 566: <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>)
1227
- 567: <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>
1228
- 568: <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>)
1229
- 569: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">pseudo_stderr</span>
1230
- 570:
1231
- 571: <span class="ruby-keyword kw">begin</span>
1232
- 572: <span class="ruby-keyword kw">yield</span>
1233
- 573: <span class="ruby-keyword kw">ensure</span>
1234
- 574: <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>
1235
- 575: <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>)
1236
- 576: <span class="ruby-identifier">$stderr</span> = <span class="ruby-identifier">old_global_stderr</span>
1237
- 577: <span class="ruby-identifier">stderr_output</span> = <span class="ruby-identifier">pseudo_stderr</span>.<span class="ruby-identifier">done!</span>
1238
- 578: <span class="ruby-keyword kw">end</span>
1239
- 579:
1240
- 580: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'success'</span>)
1241
- 581: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
1242
- 582: <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>
1243
- 583: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exception'</span>)
1244
- 584: <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>))
1245
- 585: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
1246
- 586: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1247
- 587: <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>
1248
- 588: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">'exit'</span>)
1249
- 589: <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>))
1250
- 590: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">stderr_output</span>)
1251
- 591: <span class="ruby-identifier">raise</span>
1252
- 592: <span class="ruby-keyword kw">end</span>
1253
- 593: <span class="ruby-keyword kw">end</span>
1254
- </pre>
1255
- </div>
1256
- </div>
1257
- </div>
1258
- <div class="method">
1259
- <div class="title">
1260
- <a name="M000217"></a><b>safe_fork</b>(current_location = self.class, double_fork = false) {|| ...}
1261
- </div>
1262
- <div class="description">
1263
- <p>
1264
- Fork a <a href="Utils.html#M000229">new</a> process and run the given block
1265
- inside the child process, just like fork(). Unlike fork(), this method is
1266
- safe, i.e. there&#8216;s no way for the child process to escape the block.
1267
- Any uncaught exceptions in the child process will be printed to standard
1268
- output, citing <tt>current_location</tt> as the source. Futhermore, the
1269
- child process will exit by calling Kernel#exit!, thereby bypassing any <a
1270
- href="Utils.html#M000210">at_exit</a> or ensure blocks.
1271
- </p>
1272
- <p>
1273
- If <tt>double_fork</tt> is true, then the child process will fork and
1274
- immediately exit. This technique can be used to avoid zombie processes, at
1275
- the expense of not being able to waitpid() the second child.
1276
- </p>
1277
- </div>
1278
- <div class="sourcecode">
1279
- <p class="source-link">[ <a href="javascript:toggleSource('M000217_source')" id="l_M000217_source">show source</a> ]</p>
1280
- <div id="M000217_source" class="dyn-source">
1281
- <pre>
1282
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 470</span>
1283
- 470: <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>)
1284
- 471: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">fork</span>
1285
- 472: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
1286
- 473: <span class="ruby-identifier">has_exception</span> = <span class="ruby-keyword kw">false</span>
1287
- 474: <span class="ruby-keyword kw">begin</span>
1288
- 475: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
1289
- 476: <span class="ruby-identifier">pid2</span> = <span class="ruby-identifier">fork</span>
1290
- 477: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid2</span>.<span class="ruby-identifier">nil?</span>
1291
- 478: <span class="ruby-identifier">srand</span>
1292
- 479: <span class="ruby-keyword kw">yield</span>
1293
- 480: <span class="ruby-keyword kw">end</span>
1294
- 481: <span class="ruby-keyword kw">else</span>
1295
- 482: <span class="ruby-identifier">srand</span>
1296
- 483: <span class="ruby-keyword kw">yield</span>
1297
- 484: <span class="ruby-keyword kw">end</span>
1298
- 485: <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>
1299
- 486: <span class="ruby-identifier">has_exception</span> = <span class="ruby-keyword kw">true</span>
1300
- 487: <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>)
1301
- 488: <span class="ruby-keyword kw">ensure</span>
1302
- 489: <span class="ruby-identifier">exit!</span>(<span class="ruby-identifier">has_exception</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
1303
- 490: <span class="ruby-keyword kw">end</span>
1304
- 491: <span class="ruby-keyword kw">else</span>
1305
- 492: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">double_fork</span>
1306
- 493: <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>
1307
- 494: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
1308
- 495: <span class="ruby-keyword kw">else</span>
1309
- 496: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">pid</span>
1310
- 497: <span class="ruby-keyword kw">end</span>
1311
- 498: <span class="ruby-keyword kw">end</span>
1312
- 499: <span class="ruby-keyword kw">end</span>
1313
- </pre>
1314
- </div>
1315
- </div>
1316
- </div>
1317
- <div class="method">
1318
- <div class="title">
1319
- <a name="M000226"></a><b>sanitize_spawn_options</b>(options)
1320
- </div>
1321
- <div class="sourcecode">
1322
- <p class="source-link">[ <a href="javascript:toggleSource('M000226_source')" id="l_M000226_source">show source</a> ]</p>
1323
- <div id="M000226_source" class="dyn-source">
1324
- <pre>
1325
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 815</span>
1326
- 815: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
1327
- 816: <span class="ruby-identifier">defaults</span> = {
1328
- 817: <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>,
1329
- 818: <span class="ruby-value str">&quot;environment&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;production&quot;</span>,
1330
- 819: <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>,
1331
- 820: <span class="ruby-value str">&quot;framework_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
1332
- 821: <span class="ruby-value str">&quot;app_spawner_timeout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">-1</span>,
1333
- 822: <span class="ruby-value str">&quot;print_exceptions&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
1334
- 823: }
1335
- 824: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
1336
- 825: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_group_name&quot;</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_root&quot;</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;app_group_name&quot;</span>]
1337
- 826: <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>
1338
- 827: <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>
1339
- 828: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value str">&quot;print_framework_loading_exceptions&quot;</span>)
1340
- 829: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_framework_loading_exceptions&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;print_framework_loading_exceptions&quot;</span>])
1341
- 830: <span class="ruby-keyword kw">end</span>
1342
- 831: <span class="ruby-comment cmt"># Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.</span>
1343
- 832: <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>])
1344
- 833:
1345
- 834: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;analytics&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;analytics&quot;</span>])
1346
- 835: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;show_version_in_header&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;show_version_in_header&quot;</span>])
1347
- 836:
1348
- 837: <span class="ruby-comment cmt"># Smart spawning is not supported when using ruby-debug.</span>
1349
- 838: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;debugger&quot;</span>] = <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;debugger&quot;</span>])
1350
- 839: <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;spawn_method&quot;</span>] = <span class="ruby-value str">&quot;conservative&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;debugger&quot;</span>]
1351
- 840:
1352
- 841: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
1353
- 842: <span class="ruby-keyword kw">end</span>
1354
- </pre>
1355
- </div>
1356
- </div>
1357
- </div>
1358
- <div class="method">
1359
- <div class="title">
1360
- <a name="M000227"></a><b>split_by_null_into_hash</b>(data)
1361
- </div>
1362
- <div class="description">
1363
- <p>
1364
- Split the given string into an hash. Keys and values are obtained by
1365
- splitting the string using the null character as the delimitor.
1366
- </p>
1367
- </div>
1368
- <div class="sourcecode">
1369
- <p class="source-link">[ <a href="javascript:toggleSource('M000227_source')" id="l_M000227_source">show source</a> ]</p>
1370
- <div id="M000227_source" class="dyn-source">
1371
- <pre>
1372
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 847</span>
1373
- 847: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split_by_null_into_hash</span>(<span class="ruby-identifier">data</span>)
1374
- 848: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">PhusionPassenger</span><span class="ruby-operator">::</span><span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">split_by_null_into_hash</span>(<span class="ruby-identifier">data</span>)
1375
- 849: <span class="ruby-keyword kw">end</span>
1376
- </pre>
1377
- </div>
1378
- </div>
1379
- </div>
1380
- <div class="method">
1381
- <div class="title">
1382
- <a name="M000228"></a><b>split_by_null_into_hash</b>(data)
1383
- </div>
1384
- <div class="sourcecode">
1385
- <p class="source-link">[ <a href="javascript:toggleSource('M000228_source')" id="l_M000228_source">show source</a> ]</p>
1386
- <div id="M000228_source" class="dyn-source">
1387
- <pre>
1388
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 853</span>
1389
- 853: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split_by_null_into_hash</span>(<span class="ruby-identifier">data</span>)
1390
- 854: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">split</span>(<span class="ruby-constant">NULL</span>, <span class="ruby-value">-1</span>)
1391
- 855: <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>
1392
- 856: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Hash</span>[<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>]
1393
- 857: <span class="ruby-keyword kw">end</span>
1394
- </pre>
1395
- </div>
1396
- </div>
1397
- </div>
1398
- <div class="method">
1399
- <div class="title">
1400
- <a name="M000225"></a><b>to_boolean</b>(value)
1401
- </div>
1402
- <div class="sourcecode">
1403
- <p class="source-link">[ <a href="javascript:toggleSource('M000225_source')" id="l_M000225_source">show source</a> ]</p>
1404
- <div id="M000225_source" class="dyn-source">
1405
- <pre>
1406
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 811</span>
1407
- 811: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_boolean</span>(<span class="ruby-identifier">value</span>)
1408
- 812: <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>)
1409
- 813: <span class="ruby-keyword kw">end</span>
1410
- </pre>
1411
- </div>
1412
- </div>
1413
- </div>
1414
- <div class="method">
1415
- <div class="title">
1416
- <a name="M000220"></a><b>unmarshal_and_raise_errors</b>(channel, print_exception = nil, app_type = &quot;rails&quot;)
1417
- </div>
1418
- <div class="description">
1419
- <p>
1420
- Receive status information that was sent to <tt>channel</tt> by <a
1421
- href="Utils.html#M000219">report_app_init_status</a>. If an error occured
1422
- according to the received information, then an appropriate exception will
1423
- be raised.
1424
- </p>
1425
- <p>
1426
- If <tt><a href="Utils.html#M000208">print_exception</a></tt> evaluates to
1427
- true, then the exception message and the backtrace will also be printed.
1428
- Where it is printed to depends on the type of <tt><a
1429
- href="Utils.html#M000208">print_exception</a></tt>:
1430
- </p>
1431
- <ul>
1432
- <li>If it responds to #puts, then the exception information will be printed
1433
- using this method.
1434
-
1435
- </li>
1436
- <li>If it responds to #to_str, then the exception information will be appended
1437
- to the file whose filename equals the return value of the #to_str call.
1438
-
1439
- </li>
1440
- <li>Otherwise, it will be printed to STDERR.
1441
-
1442
- </li>
1443
- </ul>
1444
- <p>
1445
- Raises:
1446
- </p>
1447
- <ul>
1448
- <li><a href="AppInitError.html">AppInitError</a>: this class wraps the
1449
- exception information received through the channel.
1450
-
1451
- </li>
1452
- <li>IOError, SystemCallError, SocketError: these errors are raised if an error
1453
- occurred while receiving the information through the channel.
1454
-
1455
- </li>
1456
- </ul>
1457
- </div>
1458
- <div class="sourcecode">
1459
- <p class="source-link">[ <a href="javascript:toggleSource('M000220_source')" id="l_M000220_source">show source</a> ]</p>
1460
- <div id="M000220_source" class="dyn-source">
1461
- <pre>
1462
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 617</span>
1463
- 617: <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>)
1464
- 618: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
1465
- 619: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
1466
- 620: <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>
1467
- 621: <span class="ruby-keyword kw">end</span>
1468
- 622: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
1469
- 623: <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>
1470
- 624: <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>)
1471
- 625: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
1472
- 626: <span class="ruby-identifier">exception</span> = <span class="ruby-constant">AppInitError</span>.<span class="ruby-identifier">new</span>(
1473
- 627: <span class="ruby-node">&quot;Application '#{@app_root}' raised an exception: &quot;</span> <span class="ruby-operator">&lt;&lt;</span>
1474
- 628: <span class="ruby-node">&quot;#{child_exception.class} (#{child_exception.message})&quot;</span>,
1475
- 629: <span class="ruby-identifier">child_exception</span>,
1476
- 630: <span class="ruby-identifier">app_type</span>,
1477
- 631: <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>)
1478
- 632: <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>
1479
- 633: <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>)
1480
- 634: <span class="ruby-identifier">stderr</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read_scalar</span>
1481
- 635: <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>,
1482
- 636: <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>)
1483
- 637: <span class="ruby-keyword kw">else</span>
1484
- 638: <span class="ruby-identifier">exception</span> = <span class="ruby-keyword kw">nil</span>
1485
- 639: <span class="ruby-keyword kw">end</span>
1486
- 640:
1487
- 641: <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>
1488
- 642: <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>)
1489
- 643: <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>)
1490
- 644: <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>)
1491
- 645: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">print_exception</span>.<span class="ruby-identifier">to_str</span>
1492
- 646: <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>
1493
- 647: <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>)
1494
- 648: <span class="ruby-keyword kw">end</span>
1495
- 649: <span class="ruby-keyword kw">else</span>
1496
- 650: <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>)
1497
- 651: <span class="ruby-keyword kw">end</span>
1498
- 652: <span class="ruby-keyword kw">end</span>
1499
- 653: <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>
1500
- 654: <span class="ruby-keyword kw">end</span>
1501
- </pre>
1502
- </div>
1503
- </div>
1504
- </div>
1505
- <div class="method">
1506
- <div class="title">
1507
- <a name="M000207"></a><b>unmarshal_exception</b>(data)
1508
- </div>
1509
- <div class="sourcecode">
1510
- <p class="source-link">[ <a href="javascript:toggleSource('M000207_source')" id="l_M000207_source">show source</a> ]</p>
1511
- <div id="M000207_source" class="dyn-source">
1512
- <pre>
1513
- <span class="ruby-comment cmt"># File lib/phusion_passenger/utils.rb, line 147</span>
1514
- 147: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">data</span>)
1515
- 148: <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">data</span>)
1516
- 149: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:is_initialization_error</span>]
1517
- 150: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:child_exception</span>]
1518
- 151: <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>])
1519
- 152: <span class="ruby-keyword kw">else</span>
1520
- 153: <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>
1521
- 154: <span class="ruby-keyword kw">end</span>
1522
- 155:
1523
- 156: <span class="ruby-identifier">exception</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>])
1524
- 157: <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">child_exception</span>
1525
- 158: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">exception</span>
1526
- 159: <span class="ruby-keyword kw">else</span>
1527
- 160: <span class="ruby-keyword kw">begin</span>
1528
- 161: <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>])
1529
- 162: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">TypeError</span>
1530
- 163: <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>])
1531
- 164: <span class="ruby-keyword kw">end</span>
1532
- 165: <span class="ruby-keyword kw">end</span>
1533
- 166: <span class="ruby-keyword kw">end</span>
1534
- </pre>
1535
- </div>
1536
- </div>
1537
- </div>
1538
- </div>
1539
-
1540
- </div>
1541
-
1542
- </body>
1543
- </html>