passenger 5.2.3 → 5.3.0

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 (241) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -0
  3. data/CONTRIBUTORS +5 -1
  4. data/build/agent.rb +22 -2
  5. data/build/cxx_tests.rb +41 -5
  6. data/build/misc.rb +4 -1
  7. data/build/support/cxx_dependency_map.rb +1746 -908
  8. data/build/support/vendor/cxx_hinted_parser/CxxHintedParser.sublime-project +8 -0
  9. data/build/support/vendor/cxx_hinted_parser/Gemfile +5 -0
  10. data/build/support/vendor/cxx_hinted_parser/Gemfile.lock +30 -0
  11. data/{src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core → build/support/vendor/cxx_hinted_parser}/LICENSE.md +1 -1
  12. data/build/support/vendor/cxx_hinted_parser/README.md +95 -0
  13. data/build/support/vendor/cxx_hinted_parser/Rakefile +4 -0
  14. data/{src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/initialize.rb → build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb} +2 -9
  15. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +239 -0
  16. data/dev/ci/README.md +15 -2
  17. data/dev/ci/lib/set-container-envvars.sh +6 -0
  18. data/dev/ci/lib/setup-container.sh +4 -1
  19. data/dev/ci/scripts/debug-console-wrapper.sh +3 -1
  20. data/dev/ci/setup-host +5 -0
  21. data/dev/ci/tests/binaries/Jenkinsfile +105 -0
  22. data/dev/ci/tests/binaries/build-linux +38 -0
  23. data/dev/ci/tests/binaries/build-macos +40 -0
  24. data/dev/ci/tests/binaries/prepare-macos +38 -0
  25. data/dev/ci/tests/binaries/test-linux +45 -0
  26. data/dev/ci/tests/binaries/test-macos +38 -0
  27. data/dev/ci/tests/debian/Jenkinsfile +2 -2
  28. data/dev/ci/tests/rpm/Jenkinsfile +1 -1
  29. data/dev/configkit-schemas/index.json +3 -24
  30. data/dev/vagrant/nginx_rakefile +0 -1
  31. data/package.json +15 -5
  32. data/resources/templates/error_renderer/.editorconfig +19 -0
  33. data/resources/templates/error_renderer/with_details/README.md +9 -0
  34. data/resources/templates/error_renderer/with_details/dist/bundle.js +33 -0
  35. data/resources/templates/error_renderer/with_details/dist/styles.css +17 -0
  36. data/resources/templates/error_renderer/with_details/src/DetailsView.jsx +52 -0
  37. data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +61 -0
  38. data/resources/templates/error_renderer/with_details/src/JourneyView.css +50 -0
  39. data/resources/templates/error_renderer/with_details/src/JourneyView.jsx +621 -0
  40. data/resources/templates/error_renderer/with_details/src/PageMain.css +114 -0
  41. data/resources/templates/error_renderer/with_details/src/PageMain.jsx +136 -0
  42. data/resources/templates/error_renderer/with_details/src/ProblemDescriptionView.jsx +14 -0
  43. data/resources/templates/error_renderer/with_details/src/ProcessDetailsView.jsx +56 -0
  44. data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.css +5 -0
  45. data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.jsx +15 -0
  46. data/resources/templates/error_renderer/with_details/src/SummaryView.jsx +35 -0
  47. data/resources/templates/error_renderer/with_details/src/SystemComponentView.css +34 -0
  48. data/resources/templates/error_renderer/with_details/src/SystemComponentView.jsx +168 -0
  49. data/resources/templates/error_renderer/with_details/src/SystemComponentsView.css +13 -0
  50. data/resources/templates/error_renderer/with_details/src/SystemComponentsView.jsx +116 -0
  51. data/resources/templates/error_renderer/with_details/src/Tab.jsx +12 -0
  52. data/resources/templates/error_renderer/with_details/src/Tabs.jsx +104 -0
  53. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +3446 -0
  54. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +293 -0
  55. data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +401 -0
  56. data/resources/templates/error_renderer/with_details/src/index.html.template +22 -0
  57. data/resources/templates/error_renderer/with_details/src/index.jsx +23 -0
  58. data/resources/templates/error_renderer/with_details/webpack.config.js +47 -0
  59. data/resources/templates/error_renderer/without_details/dist/bundle.js +1 -0
  60. data/resources/templates/error_renderer/without_details/dist/styles.css +1 -0
  61. data/resources/templates/{undisclosed_error.html.template → error_renderer/without_details/src/index.html.template} +7 -11
  62. data/resources/templates/error_renderer/without_details/src/index.js +1 -0
  63. data/resources/templates/{error_layout.css → error_renderer/without_details/src/main.css} +5 -2
  64. data/resources/templates/error_renderer/without_details/webpack.config.js +42 -0
  65. data/src/agent/AgentMain.cpp +3 -3
  66. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +13 -0
  67. data/src/agent/Core/ApplicationPool/Common.h +3 -4
  68. data/src/agent/Core/ApplicationPool/Context.h +27 -17
  69. data/src/agent/Core/ApplicationPool/Group.h +3 -1
  70. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +2 -12
  71. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +55 -10
  72. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
  73. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
  74. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +13 -6
  75. data/src/agent/Core/ApplicationPool/Implementation.cpp +16 -100
  76. data/src/agent/Core/ApplicationPool/Options.h +8 -65
  77. data/src/agent/Core/ApplicationPool/Pool.h +4 -21
  78. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -60
  79. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +10 -13
  80. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +3 -8
  81. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +2 -34
  82. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  83. data/src/agent/Core/ApplicationPool/Process.cpp +17 -12
  84. data/src/agent/Core/ApplicationPool/Process.h +146 -93
  85. data/src/agent/Core/ApplicationPool/Session.h +2 -2
  86. data/src/agent/Core/ApplicationPool/Socket.h +28 -27
  87. data/src/agent/Core/Config.h +1 -3
  88. data/src/agent/Core/ConfigChange.cpp +2 -4
  89. data/src/agent/Core/Controller.h +2 -8
  90. data/src/agent/Core/Controller/BufferBody.cpp +0 -2
  91. data/src/agent/Core/Controller/CheckoutSession.cpp +12 -24
  92. data/src/agent/Core/Controller/Config.h +1 -9
  93. data/src/agent/Core/Controller/ForwardResponse.cpp +0 -34
  94. data/src/agent/Core/Controller/Hooks.cpp +0 -7
  95. data/src/agent/Core/Controller/InitRequest.cpp +0 -43
  96. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +0 -4
  97. data/src/agent/Core/Controller/Request.h +1 -35
  98. data/src/agent/Core/Controller/SendRequest.cpp +0 -32
  99. data/src/agent/Core/CoreMain.cpp +19 -32
  100. data/src/agent/Core/SpawningKit/Config.h +329 -55
  101. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +369 -0
  102. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +307 -0
  103. data/src/agent/Core/SpawningKit/Context.h +211 -0
  104. data/src/agent/Core/SpawningKit/DirectSpawner.h +112 -122
  105. data/src/agent/Core/SpawningKit/DummySpawner.h +59 -20
  106. data/src/agent/Core/SpawningKit/ErrorRenderer.h +117 -0
  107. data/src/agent/Core/SpawningKit/Exceptions.h +1157 -0
  108. data/src/agent/Core/SpawningKit/Factory.h +24 -17
  109. data/src/agent/Core/SpawningKit/{BackgroundIOCapturer.h → Handshake/BackgroundIOCapturer.h} +48 -18
  110. data/src/agent/Core/SpawningKit/Handshake/Perform.h +1650 -0
  111. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +582 -0
  112. data/src/agent/Core/SpawningKit/Handshake/Session.h +91 -0
  113. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +100 -0
  114. data/src/agent/Core/SpawningKit/Journey.h +561 -0
  115. data/src/agent/Core/SpawningKit/PipeWatcher.h +41 -18
  116. data/src/agent/Core/SpawningKit/README.md +534 -0
  117. data/src/agent/Core/SpawningKit/Result.h +182 -7
  118. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +69 -0
  119. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +110 -0
  120. data/src/agent/Core/SpawningKit/SmartSpawner.h +1027 -562
  121. data/src/agent/Core/SpawningKit/Spawner.h +70 -1134
  122. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +3 -33
  123. data/src/agent/README.md +2 -3
  124. data/src/agent/Shared/ApiServerUtils.h +2 -3
  125. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +932 -0
  126. data/src/agent/Watchdog/Config.h +1 -3
  127. data/src/agent/Watchdog/WatchdogMain.cpp +2 -1
  128. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +5 -0
  129. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
  130. data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +22 -13
  131. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +5 -0
  132. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +3 -0
  133. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +13 -0
  134. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -0
  135. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +13 -0
  136. data/src/cxx_supportlib/Constants.h +3 -1
  137. data/src/cxx_supportlib/Exceptions.h +0 -121
  138. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +7 -6
  139. data/src/cxx_supportlib/LoggingKit/Logging.h +3 -1
  140. data/src/cxx_supportlib/Utils.cpp +42 -0
  141. data/src/cxx_supportlib/Utils.h +7 -0
  142. data/src/cxx_supportlib/Utils/IOUtils.cpp +58 -0
  143. data/src/cxx_supportlib/Utils/IOUtils.h +13 -0
  144. data/src/cxx_supportlib/Utils/JsonUtils.h +130 -23
  145. data/src/cxx_supportlib/Utils/ScopeGuard.h +9 -4
  146. data/src/cxx_supportlib/Utils/StrIntUtils.cpp +7 -0
  147. data/src/cxx_supportlib/Utils/StrIntUtils.h +1 -0
  148. data/src/cxx_supportlib/Utils/SystemTime.h +1 -1
  149. data/src/cxx_supportlib/Utils/Timer.h +1 -1
  150. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +6 -4
  151. data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -0
  152. data/src/helper-scripts/node-loader.js +54 -59
  153. data/src/helper-scripts/rack-loader.rb +63 -60
  154. data/src/helper-scripts/rack-preloader.rb +125 -72
  155. data/src/helper-scripts/wsgi-loader.py +100 -43
  156. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +120 -112
  157. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +15 -8
  158. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +142 -142
  159. data/src/nginx_module/ConfigGeneral/ManifestGeneration.c +26 -15
  160. data/src/nginx_module/ConfigGeneral/ManifestGeneration.h +3 -0
  161. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +76 -70
  162. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +114 -99
  163. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +170 -156
  164. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +38 -35
  165. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +5 -1
  166. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  167. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +14 -1
  168. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +8 -0
  169. data/src/ruby_supportlib/phusion_passenger/common_library.rb +0 -3
  170. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +0 -1
  171. data/src/ruby_supportlib/phusion_passenger/constants.rb +2 -0
  172. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +646 -238
  173. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +117 -95
  174. data/src/ruby_supportlib/phusion_passenger/packaging.rb +0 -1
  175. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +5 -1
  176. data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +92 -69
  177. data/src/ruby_supportlib/phusion_passenger/public_api.rb +0 -17
  178. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +0 -3
  179. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +4 -5
  180. data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +0 -22
  181. metadata +64 -67
  182. data/resources/templates/error_layout.html.template +0 -86
  183. data/resources/templates/general_error.html.template +0 -1
  184. data/resources/templates/general_error_with_html.html.template +0 -1
  185. data/src/agent/Core/ApplicationPool/ErrorRenderer.h +0 -131
  186. data/src/agent/Core/SpawningKit/Options.h +0 -41
  187. data/src/agent/Core/UnionStation/Connection.h +0 -173
  188. data/src/agent/Core/UnionStation/Context.h +0 -536
  189. data/src/agent/Core/UnionStation/StopwatchLog.h +0 -147
  190. data/src/agent/Core/UnionStation/Transaction.h +0 -249
  191. data/src/agent/SpawnPreparer/SpawnPreparerMain.cpp +0 -208
  192. data/src/cxx_supportlib/UnionStationFilterSupport.cpp +0 -67
  193. data/src/cxx_supportlib/UnionStationFilterSupport.h +0 -1622
  194. data/src/nodejs_supportlib/phusion_passenger/log_express.js +0 -106
  195. data/src/nodejs_supportlib/phusion_passenger/log_mongodb.js +0 -202
  196. data/src/nodejs_supportlib/phusion_passenger/ustreporter.js +0 -227
  197. data/src/nodejs_supportlib/phusion_passenger/ustrouter_connector.js +0 -448
  198. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/CONFIG.md +0 -37
  199. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile +0 -17
  200. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile.lock +0 -59
  201. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README-API.md +0 -5
  202. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README.md +0 -117
  203. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Rakefile +0 -115
  204. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +0 -423
  205. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +0 -238
  206. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/connection.rb +0 -67
  207. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/context.rb +0 -281
  208. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/lock.rb +0 -62
  209. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/log.rb +0 -66
  210. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/message_channel.rb +0 -157
  211. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter.rb +0 -150
  212. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/basics.rb +0 -199
  213. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/controllers.rb +0 -187
  214. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/misc.rb +0 -303
  215. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/view_rendering.rb +0 -91
  216. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_json.rb +0 -396
  217. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/spec_helper.rb +0 -279
  218. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/time_point.rb +0 -39
  219. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb +0 -173
  220. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/utils.rb +0 -177
  221. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version.rb +0 -32
  222. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +0 -44
  223. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.example +0 -16
  224. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +0 -20
  225. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +0 -18
  226. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/union_station_hooks_core.gemspec +0 -23
  227. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile +0 -14
  228. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile.lock +0 -45
  229. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/LICENSE.md +0 -19
  230. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/README.md +0 -104
  231. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Rakefile +0 -160
  232. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails.rb +0 -200
  233. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_controller_extension.rb +0 -45
  234. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_view_subscriber.rb +0 -55
  235. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_record_subscriber.rb +0 -41
  236. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_benchmarkable_extension.rb +0 -47
  237. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_cache_subscriber.rb +0 -79
  238. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/exception_logger.rb +0 -57
  239. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version.rb +0 -32
  240. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version_data.rb +0 -44
  241. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/union_station_hooks_rails.gemspec +0 -34
@@ -145,7 +145,7 @@ using namespace std;
145
145
  * security_update_checker_interval unsigned integer - default(86400)
146
146
  * security_update_checker_proxy_url string - -
147
147
  * security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
148
- * server_software string - default("Phusion_Passenger/5.2.3")
148
+ * server_software string - default("Phusion_Passenger/5.3.0")
149
149
  * setsid boolean - default(false)
150
150
  * show_version_in_header boolean - default(true)
151
151
  * single_app_mode_app_root string - default,read_only
@@ -157,8 +157,6 @@ using namespace std;
157
157
  * turbocaching boolean - default(true),read_only
158
158
  * user string - default,read_only
159
159
  * user_switching boolean - default(true)
160
- * ust_router_address string - -
161
- * ust_router_password string - secret
162
160
  * vary_turbocache_by_cookie string - -
163
161
  * watchdog_api_server_accept_burst_count unsigned integer - default(32)
164
162
  * watchdog_api_server_addresses array of strings - default([]),read_only
@@ -535,7 +535,8 @@ usage() {
535
535
  printf("Usage: " AGENT_EXE " watchdog <OPTIONS...>\n");
536
536
  printf("Runs the " PROGRAM_NAME " watchdog.\n\n");
537
537
  printf("The watchdog runs and supervises various " PROGRAM_NAME " agent processes,\n");
538
- printf("namely the core and the UstRouter. Arguments marked with \"[A]\", e.g.\n");
538
+ printf("at this moment only the core (there was also a process called UstRouter but\n");
539
+ printf("it no longer exists). Arguments marked with \"[A]\", e.g.\n");
539
540
  printf("--passenger-root and --log-level, are automatically passed to all supervised\n");
540
541
  printf("agents, unless you explicitly override them by passing extra arguments to a\n");
541
542
  printf("supervised agent specifically. You can pass arguments to a supervised agent by\n");
@@ -83,6 +83,11 @@ AP_INIT_TAKE1("PassengerAppGroupName",
83
83
  NULL,
84
84
  RSRC_CONF | ACCESS_CONF,
85
85
  "Application process group name."),
86
+ AP_INIT_TAKE1("PassengerAppLogFile",
87
+ (Take1Func) cmd_passenger_enterprise_only,
88
+ NULL,
89
+ RSRC_CONF | ACCESS_CONF,
90
+ "Application log file path."),
86
91
  AP_INIT_TAKE1("PassengerAppRoot",
87
92
  (Take1Func) cmd_passenger_app_root,
88
93
  NULL,
@@ -149,6 +149,11 @@ ConfigManifestGenerator::autoGenerated_setAppConfigDefaults() {
149
149
  "PassengerAppGroupName",
150
150
  P_STATIC_STRING("PassengerAppRoot plus PassengerAppEnv"));
151
151
 
152
+ addOptionsContainerDynamicDefault(
153
+ defaultAppConfigContainer,
154
+ "PassengerAppLogFile",
155
+ P_STATIC_STRING("PassengerLogFile"));
156
+
152
157
  addOptionsContainerDynamicDefault(
153
158
  defaultAppConfigContainer,
154
159
  "PassengerAppRoot",
@@ -100,13 +100,13 @@ private:
100
100
  *appOptionsContainer = &appConfigContainer["options"];
101
101
  *locOptionsContainer = &appConfigContainer["default_location_configuration"];
102
102
 
103
- // Create a default value for passenger_app_root
104
- // if we just created this config container
103
+ // Create a default value for PassengerAppGroupName and
104
+ // PassengerAppRoot if we just created this config container
105
105
  if ((*appOptionsContainer)->empty()) {
106
- addOptionsContainerStaticDefaultStr(**appOptionsContainer,
106
+ addOptionsContainerInferredDefaultStr(**appOptionsContainer,
107
107
  "PassengerAppGroupName",
108
108
  appGroupName);
109
- addOptionsContainerStaticDefaultStr(**appOptionsContainer,
109
+ addOptionsContainerInferredDefaultStr(**appOptionsContainer,
110
110
  "PassengerAppRoot",
111
111
  inferDefaultAppRoot(csconf));
112
112
  }
@@ -531,8 +531,8 @@ private:
531
531
  optionContainer["value_hierarchy"].append(hierarchyMember);
532
532
  }
533
533
 
534
- Json::Value &addOptionsContainerStaticDefault(Json::Value &optionsContainer,
535
- const char *optionName)
534
+ Json::Value &addOptionsContainerDefault(Json::Value &optionsContainer,
535
+ const char *defaultType, const char *optionName)
536
536
  {
537
537
  Json::Value &optionContainer = optionsContainer[optionName];
538
538
  if (optionContainer.isNull()) {
@@ -540,7 +540,7 @@ private:
540
540
  }
541
541
 
542
542
  Json::Value hierarchyMember;
543
- hierarchyMember["source"]["type"] = "default";
543
+ hierarchyMember["source"]["type"] = defaultType;
544
544
 
545
545
  return optionContainer["value_hierarchy"].append(hierarchyMember);
546
546
  }
@@ -548,8 +548,8 @@ private:
548
548
  void addOptionsContainerStaticDefaultStr(Json::Value &optionsContainer,
549
549
  const char *optionName, const StaticString &value)
550
550
  {
551
- Json::Value &hierarchyMember = addOptionsContainerStaticDefault(
552
- optionsContainer, optionName);
551
+ Json::Value &hierarchyMember = addOptionsContainerDefault(
552
+ optionsContainer, "default", optionName);
553
553
  hierarchyMember["value"] = Json::Value(value.data(),
554
554
  value.data() + value.size());
555
555
  }
@@ -557,19 +557,28 @@ private:
557
557
  void addOptionsContainerStaticDefaultInt(Json::Value &optionsContainer,
558
558
  const char *optionName, int value)
559
559
  {
560
- Json::Value &hierarchyMember = addOptionsContainerStaticDefault(
561
- optionsContainer, optionName);
560
+ Json::Value &hierarchyMember = addOptionsContainerDefault(
561
+ optionsContainer, "default", optionName);
562
562
  hierarchyMember["value"] = value;
563
563
  }
564
564
 
565
565
  void addOptionsContainerStaticDefaultBool(Json::Value &optionsContainer,
566
566
  const char *optionName, bool value)
567
567
  {
568
- Json::Value &hierarchyMember = addOptionsContainerStaticDefault(
569
- optionsContainer, optionName);
568
+ Json::Value &hierarchyMember = addOptionsContainerDefault(
569
+ optionsContainer, "default", optionName);
570
570
  hierarchyMember["value"] = value;
571
571
  }
572
572
 
573
+ void addOptionsContainerInferredDefaultStr(Json::Value &optionsContainer,
574
+ const char *optionName, const StaticString &value)
575
+ {
576
+ Json::Value &hierarchyMember = addOptionsContainerDefault(
577
+ optionsContainer, "inferred-default", optionName);
578
+ hierarchyMember["value"] = Json::Value(value.data(),
579
+ value.data() + value.size());
580
+ }
581
+
573
582
  void jsonAppendValues(Json::Value &doc, const Json::Value &doc2) {
574
583
  Json::Value::const_iterator it, end = doc2.end();
575
584
 
@@ -49,6 +49,9 @@ createDirConfig_autoGenerated(DirConfig *config) {
49
49
  /*
50
50
  * config->mAppGroupName: default initialized
51
51
  */
52
+ /*
53
+ * config->mAppLogFile: default initialized
54
+ */
52
55
  /*
53
56
  * config->mAppRoot: default initialized
54
57
  */
@@ -110,6 +113,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
110
113
  config->mAllowEncodedSlashesSourceLine = 0;
111
114
  config->mAppEnvSourceLine = 0;
112
115
  config->mAppGroupNameSourceLine = 0;
116
+ config->mAppLogFileSourceLine = 0;
113
117
  config->mAppRootSourceLine = 0;
114
118
  config->mAppTypeSourceLine = 0;
115
119
  config->mBaseURIsSourceLine = 0;
@@ -143,6 +147,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
143
147
  config->mAllowEncodedSlashesExplicitlySet = false;
144
148
  config->mAppEnvExplicitlySet = false;
145
149
  config->mAppGroupNameExplicitlySet = false;
150
+ config->mAppLogFileExplicitlySet = false;
146
151
  config->mAppRootExplicitlySet = false;
147
152
  config->mAppTypeExplicitlySet = false;
148
153
  config->mBaseURIsExplicitlySet = false;
@@ -49,6 +49,9 @@ constructRequestHeaders_autoGenerated(request_rec *r, Passenger::Apache2Module::
49
49
  addHeader(result, StaticString("!~PASSENGER_APP_GROUP_NAME",
50
50
  sizeof("!~PASSENGER_APP_GROUP_NAME") - 1),
51
51
  config->mAppGroupName);
52
+ addHeader(result, StaticString("!~PASSENGER_APP_LOG_FILE",
53
+ sizeof("!~PASSENGER_APP_LOG_FILE") - 1),
54
+ config->mAppLogFile);
52
55
  addHeader(r, result, StaticString("!~PASSENGER_FORCE_MAX_CONCURRENT_REQUESTS_PER_PROCESS",
53
56
  sizeof("!~PASSENGER_FORCE_MAX_CONCURRENT_REQUESTS_PER_PROCESS") - 1),
54
57
  config->mForceMaxConcurrentRequestsPerProcess);
@@ -85,6 +85,19 @@ ConfigManifestGenerator::autoGenerated_generateConfigManifestForDirConfig(server
85
85
  pdconf->mAppGroupName.data(),
86
86
  pdconf->mAppGroupName.data() + pdconf->mAppGroupName.size());
87
87
  }
88
+ if (pdconf->mAppLogFileExplicitlySet) {
89
+ findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
90
+ pdconf, context, &appOptionsContainer, &locOptionsContainer);
91
+ Json::Value &optionContainer = findOrCreateOptionContainer(*appOptionsContainer,
92
+ "PassengerAppLogFile",
93
+ sizeof("PassengerAppLogFile") - 1);
94
+ Json::Value &hierarchyMember = addOptionContainerHierarchyMember(optionContainer,
95
+ pdconf->mAppLogFileSourceFile,
96
+ pdconf->mAppLogFileSourceLine);
97
+ hierarchyMember["value"] = Json::Value(
98
+ pdconf->mAppLogFile.data(),
99
+ pdconf->mAppLogFile.data() + pdconf->mAppLogFile.size());
100
+ }
88
101
  if (pdconf->mAppRootExplicitlySet) {
89
102
  findOrCreateAppAndLocOptionsContainers(serverRec, csconf, cdconf,
90
103
  pdconf, context, &appOptionsContainer, &locOptionsContainer);
@@ -54,6 +54,10 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
54
54
  (!add->mAppGroupName.empty())
55
55
  ? add->mAppGroupName
56
56
  : base->mAppGroupName;
57
+ config->mAppLogFile =
58
+ (!add->mAppLogFile.empty())
59
+ ? add->mAppLogFile
60
+ : base->mAppLogFile;
57
61
  config->mAppRoot =
58
62
  (!add->mAppRoot.empty())
59
63
  ? add->mAppRoot
@@ -174,6 +178,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
174
178
  config->mAllowEncodedSlashesSourceFile = add->mAllowEncodedSlashesSourceFile;
175
179
  config->mAppEnvSourceFile = add->mAppEnvSourceFile;
176
180
  config->mAppGroupNameSourceFile = add->mAppGroupNameSourceFile;
181
+ config->mAppLogFileSourceFile = add->mAppLogFileSourceFile;
177
182
  config->mAppRootSourceFile = add->mAppRootSourceFile;
178
183
  config->mAppTypeSourceFile = add->mAppTypeSourceFile;
179
184
  config->mBaseURIsSourceFile = add->mBaseURIsSourceFile;
@@ -207,6 +212,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
207
212
  config->mAllowEncodedSlashesSourceLine = add->mAllowEncodedSlashesSourceLine;
208
213
  config->mAppEnvSourceLine = add->mAppEnvSourceLine;
209
214
  config->mAppGroupNameSourceLine = add->mAppGroupNameSourceLine;
215
+ config->mAppLogFileSourceLine = add->mAppLogFileSourceLine;
210
216
  config->mAppRootSourceLine = add->mAppRootSourceLine;
211
217
  config->mAppTypeSourceLine = add->mAppTypeSourceLine;
212
218
  config->mBaseURIsSourceLine = add->mBaseURIsSourceLine;
@@ -240,6 +246,7 @@ mergeDirConfig_autoGenerated(DirConfig *config, DirConfig *base, DirConfig *add)
240
246
  config->mAllowEncodedSlashesExplicitlySet = add->mAllowEncodedSlashesExplicitlySet;
241
247
  config->mAppEnvExplicitlySet = add->mAppEnvExplicitlySet;
242
248
  config->mAppGroupNameExplicitlySet = add->mAppGroupNameExplicitlySet;
249
+ config->mAppLogFileExplicitlySet = add->mAppLogFileExplicitlySet;
243
250
  config->mAppRootExplicitlySet = add->mAppRootExplicitlySet;
244
251
  config->mAppTypeExplicitlySet = add->mAppTypeExplicitlySet;
245
252
  config->mBaseURIsExplicitlySet = add->mBaseURIsExplicitlySet;
@@ -129,6 +129,11 @@ struct AutoGeneratedDirConfig {
129
129
  */
130
130
  StaticString mAppGroupName;
131
131
 
132
+ /*
133
+ * Application log file path.
134
+ */
135
+ StaticString mAppLogFile;
136
+
132
137
  /*
133
138
  * The application's root directory.
134
139
  */
@@ -218,6 +223,7 @@ struct AutoGeneratedDirConfig {
218
223
  StaticString mStartTimeoutSourceFile;
219
224
  StaticString mAppEnvSourceFile;
220
225
  StaticString mAppGroupNameSourceFile;
226
+ StaticString mAppLogFileSourceFile;
221
227
  StaticString mAppRootSourceFile;
222
228
  StaticString mAppTypeSourceFile;
223
229
  StaticString mGroupSourceFile;
@@ -251,6 +257,7 @@ struct AutoGeneratedDirConfig {
251
257
  unsigned int mStartTimeoutSourceLine;
252
258
  unsigned int mAppEnvSourceLine;
253
259
  unsigned int mAppGroupNameSourceLine;
260
+ unsigned int mAppLogFileSourceLine;
254
261
  unsigned int mAppRootSourceLine;
255
262
  unsigned int mAppTypeSourceLine;
256
263
  unsigned int mGroupSourceLine;
@@ -284,6 +291,7 @@ struct AutoGeneratedDirConfig {
284
291
  bool mStartTimeoutExplicitlySet: 1;
285
292
  bool mAppEnvExplicitlySet: 1;
286
293
  bool mAppGroupNameExplicitlySet: 1;
294
+ bool mAppLogFileExplicitlySet: 1;
287
295
  bool mAppRootExplicitlySet: 1;
288
296
  bool mAppTypeExplicitlySet: 1;
289
297
  bool mGroupExplicitlySet: 1;
@@ -454,6 +462,11 @@ struct AutoGeneratedDirConfig {
454
462
  return mAppGroupName;
455
463
  }
456
464
 
465
+ StaticString
466
+ getAppLogFile() const {
467
+ return mAppLogFile;
468
+ }
469
+
457
470
  StaticString
458
471
  getAppRoot() const {
459
472
  return mAppRoot;
@@ -81,11 +81,13 @@
81
81
  #define PASSENGER_API_VERSION_MAJOR 0
82
82
  #define PASSENGER_API_VERSION_MINOR 3
83
83
  #define PASSENGER_DEFAULT_USER "nobody"
84
- #define PASSENGER_VERSION "5.2.3"
84
+ #define PASSENGER_VERSION "5.3.0"
85
85
  #define POOL_HELPER_THREAD_STACK_SIZE 262144
86
86
  #define PROCESS_SHUTDOWN_TIMEOUT 60
87
87
  #define PROCESS_SHUTDOWN_TIMEOUT_DISPLAY "1 minute"
88
+ #define PROGRAM_AUTHOR "Phusion"
88
89
  #define PROGRAM_NAME "Phusion Passenger"
90
+ #define PROGRAM_WEBSITE "https://www.phusionpassenger.com"
89
91
  #define RPM_APACHE_MODULE_PACKAGE "mod_passenger"
90
92
  #define RPM_DEV_PACKAGE "passenger-devel"
91
93
  #define RPM_MAIN_PACKAGE "passenger"
@@ -245,127 +245,6 @@ public:
245
245
  virtual const char *what() const throw() { return msg.c_str(); }
246
246
  };
247
247
 
248
- /**
249
- * Thrown when SpawnManager or ApplicationPool fails to spawn an application
250
- * instance. The exception may contain an error page. This error page contains
251
- * detailed information about the error and may be in HTML format. The error
252
- * page always contains enough information so that showing `what()` is not
253
- * necessary.
254
- */
255
- class SpawnException: public oxt::tracable_exception {
256
- public:
257
- enum ErrorKind {
258
- UNDEFINED_ERROR,
259
- /** The preloader failed to start, not due to a wrong protocol message.
260
- * It did not explicitly supply an error message.
261
- */
262
- PRELOADER_STARTUP_ERROR,
263
- /** The preloader sent a wrong protocol message during startup. */
264
- PRELOADER_STARTUP_PROTOCOL_ERROR,
265
- /** The preloader timed out during startup. */
266
- PRELOADER_STARTUP_TIMEOUT,
267
- /** The preloader failed to start, not due to a wrong protocol message.
268
- * It DID explicitly supply an error message. */
269
- PRELOADER_STARTUP_EXPLAINABLE_ERROR,
270
- /** The application failed to start, not due to a wrong protocol message.
271
- * It did not explicitly supply an error message. */
272
- APP_STARTUP_ERROR,
273
- /** The application sent a wrong protocol message during startup. */
274
- APP_STARTUP_PROTOCOL_ERROR,
275
- /** The application timed out during startup. */
276
- APP_STARTUP_TIMEOUT,
277
- /** The application failed to start, not due to a wrong protocol message.
278
- * It DID explicitly supply an error message. */
279
- APP_STARTUP_EXPLAINABLE_ERROR
280
- };
281
-
282
- private:
283
- ErrorKind errorKind;
284
- string msg;
285
- bool m_hasErrorPage;
286
- bool m_isHTML;
287
- string m_errorPage;
288
- string preloaderCommand;
289
- map<string, string> annotations;
290
-
291
- public:
292
- SpawnException(const string &message, ErrorKind errorKind = UNDEFINED_ERROR)
293
- : msg(message)
294
- {
295
- this->errorKind = errorKind;
296
- m_hasErrorPage = false;
297
- m_isHTML = false;
298
- }
299
-
300
- SpawnException(const string &message, const string &errorPage,
301
- bool isHTML = true, ErrorKind errorKind = UNDEFINED_ERROR)
302
- : msg(message), m_errorPage(errorPage)
303
- {
304
- this->errorKind = errorKind;
305
- m_hasErrorPage = true;
306
- m_isHTML = isHTML;
307
- }
308
-
309
- virtual ~SpawnException() throw() {}
310
-
311
- virtual const char *what() const throw() {
312
- return msg.c_str();
313
- }
314
-
315
- bool hasErrorPage() const {
316
- return m_hasErrorPage;
317
- }
318
-
319
- const string &getErrorPage() const {
320
- return m_errorPage;
321
- }
322
-
323
- bool isHTML() const {
324
- return m_isHTML;
325
- }
326
-
327
- ErrorKind getErrorKind() const {
328
- return errorKind;
329
- }
330
-
331
- SpawnException &setPreloaderCommand(const string &filename) {
332
- preloaderCommand = filename;
333
- return *this;
334
- }
335
-
336
- const string &getPreloaderCommand() const {
337
- return preloaderCommand;
338
- }
339
-
340
- void addAnnotations(const map<string, string> &annotations) {
341
- map<string, string>::const_iterator it, end = annotations.end();
342
- for (it = annotations.begin(); it != end; it++) {
343
- this->annotations[it->first] = it->second;
344
- }
345
- }
346
-
347
- const map<string, string> &getAnnotations() const {
348
- return annotations;
349
- }
350
-
351
- string operator[](const string &name) const {
352
- return get(name);
353
- }
354
-
355
- void set(const string &name, const string &value) {
356
- annotations[name] = value;
357
- }
358
-
359
- string get(const string &name) const {
360
- map<string, string>::const_iterator it = annotations.find(name);
361
- if (it == annotations.end()) {
362
- return string();
363
- } else {
364
- return it->second;
365
- }
366
- }
367
- };
368
-
369
248
  /**
370
249
  * Indicates that a Pool::get() or Pool::asyncGet() request was denied.
371
250
  * The request never reached a process. This could be because, before the
@@ -432,7 +432,9 @@ realLogAppOutput(const HashedStaticString &groupName, int targetFd,
432
432
  }
433
433
 
434
434
  void
435
- logAppOutput(const HashedStaticString &groupName, pid_t pid, const char *channelName, const char *message, unsigned int size, const StaticString &appLogFile) {
435
+ logAppOutput(const HashedStaticString &groupName, pid_t pid, const StaticString &channelName,
436
+ const char *message, unsigned int size, const StaticString &appLogFile)
437
+ {
436
438
  int targetFd;
437
439
  bool saveLog = false;
438
440
 
@@ -457,7 +459,7 @@ logAppOutput(const HashedStaticString &groupName, pid_t pid, const char *channel
457
459
  }
458
460
  }
459
461
  char pidStr[sizeof("4294967295")];
460
- unsigned int pidStrLen, channelNameLen, totalLen;
462
+ unsigned int pidStrLen, totalLen;
461
463
 
462
464
  try {
463
465
  pidStrLen = integerToOtherBase<pid_t, 10>(pid, pidStr, sizeof(pidStr));
@@ -467,21 +469,20 @@ logAppOutput(const HashedStaticString &groupName, pid_t pid, const char *channel
467
469
  pidStrLen = 1;
468
470
  }
469
471
 
470
- channelNameLen = strlen(channelName);
471
- totalLen = (sizeof("App X Y: \n") - 2) + pidStrLen + channelNameLen + size;
472
+ totalLen = (sizeof("App X Y: \n") - 2) + pidStrLen + channelName.size() + size;
472
473
  if (totalLen < 1024) {
473
474
  char buf[1024];
474
475
  realLogAppOutput(groupName, targetFd,
475
476
  buf, sizeof(buf),
476
477
  pidStr, pidStrLen,
477
- channelName, channelNameLen,
478
+ channelName.data(), channelName.size(),
478
479
  message, size, fd, saveLog);
479
480
  } else {
480
481
  DynamicBuffer buf(totalLen);
481
482
  realLogAppOutput(groupName, targetFd,
482
483
  buf.data, totalLen,
483
484
  pidStr, pidStrLen,
484
- channelName, channelNameLen,
485
+ channelName.data(), channelName.size(),
485
486
  message, size, fd, saveLog);
486
487
  }
487
488
  if(fd > -1){close(fd);}