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.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -0
- data/CONTRIBUTORS +5 -1
- data/build/agent.rb +22 -2
- data/build/cxx_tests.rb +41 -5
- data/build/misc.rb +4 -1
- data/build/support/cxx_dependency_map.rb +1746 -908
- data/build/support/vendor/cxx_hinted_parser/CxxHintedParser.sublime-project +8 -0
- data/build/support/vendor/cxx_hinted_parser/Gemfile +5 -0
- data/build/support/vendor/cxx_hinted_parser/Gemfile.lock +30 -0
- data/{src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core → build/support/vendor/cxx_hinted_parser}/LICENSE.md +1 -1
- data/build/support/vendor/cxx_hinted_parser/README.md +95 -0
- data/build/support/vendor/cxx_hinted_parser/Rakefile +4 -0
- 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
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +239 -0
- data/dev/ci/README.md +15 -2
- data/dev/ci/lib/set-container-envvars.sh +6 -0
- data/dev/ci/lib/setup-container.sh +4 -1
- data/dev/ci/scripts/debug-console-wrapper.sh +3 -1
- data/dev/ci/setup-host +5 -0
- data/dev/ci/tests/binaries/Jenkinsfile +105 -0
- data/dev/ci/tests/binaries/build-linux +38 -0
- data/dev/ci/tests/binaries/build-macos +40 -0
- data/dev/ci/tests/binaries/prepare-macos +38 -0
- data/dev/ci/tests/binaries/test-linux +45 -0
- data/dev/ci/tests/binaries/test-macos +38 -0
- data/dev/ci/tests/debian/Jenkinsfile +2 -2
- data/dev/ci/tests/rpm/Jenkinsfile +1 -1
- data/dev/configkit-schemas/index.json +3 -24
- data/dev/vagrant/nginx_rakefile +0 -1
- data/package.json +15 -5
- data/resources/templates/error_renderer/.editorconfig +19 -0
- data/resources/templates/error_renderer/with_details/README.md +9 -0
- data/resources/templates/error_renderer/with_details/dist/bundle.js +33 -0
- data/resources/templates/error_renderer/with_details/dist/styles.css +17 -0
- data/resources/templates/error_renderer/with_details/src/DetailsView.jsx +52 -0
- data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +61 -0
- data/resources/templates/error_renderer/with_details/src/JourneyView.css +50 -0
- data/resources/templates/error_renderer/with_details/src/JourneyView.jsx +621 -0
- data/resources/templates/error_renderer/with_details/src/PageMain.css +114 -0
- data/resources/templates/error_renderer/with_details/src/PageMain.jsx +136 -0
- data/resources/templates/error_renderer/with_details/src/ProblemDescriptionView.jsx +14 -0
- data/resources/templates/error_renderer/with_details/src/ProcessDetailsView.jsx +56 -0
- data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.css +5 -0
- data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.jsx +15 -0
- data/resources/templates/error_renderer/with_details/src/SummaryView.jsx +35 -0
- data/resources/templates/error_renderer/with_details/src/SystemComponentView.css +34 -0
- data/resources/templates/error_renderer/with_details/src/SystemComponentView.jsx +168 -0
- data/resources/templates/error_renderer/with_details/src/SystemComponentsView.css +13 -0
- data/resources/templates/error_renderer/with_details/src/SystemComponentsView.jsx +116 -0
- data/resources/templates/error_renderer/with_details/src/Tab.jsx +12 -0
- data/resources/templates/error_renderer/with_details/src/Tabs.jsx +104 -0
- data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +3446 -0
- data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +293 -0
- data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +401 -0
- data/resources/templates/error_renderer/with_details/src/index.html.template +22 -0
- data/resources/templates/error_renderer/with_details/src/index.jsx +23 -0
- data/resources/templates/error_renderer/with_details/webpack.config.js +47 -0
- data/resources/templates/error_renderer/without_details/dist/bundle.js +1 -0
- data/resources/templates/error_renderer/without_details/dist/styles.css +1 -0
- data/resources/templates/{undisclosed_error.html.template → error_renderer/without_details/src/index.html.template} +7 -11
- data/resources/templates/error_renderer/without_details/src/index.js +1 -0
- data/resources/templates/{error_layout.css → error_renderer/without_details/src/main.css} +5 -2
- data/resources/templates/error_renderer/without_details/webpack.config.js +42 -0
- data/src/agent/AgentMain.cpp +3 -3
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +13 -0
- data/src/agent/Core/ApplicationPool/Common.h +3 -4
- data/src/agent/Core/ApplicationPool/Context.h +27 -17
- data/src/agent/Core/ApplicationPool/Group.h +3 -1
- data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +2 -12
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +55 -10
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +13 -6
- data/src/agent/Core/ApplicationPool/Implementation.cpp +16 -100
- data/src/agent/Core/ApplicationPool/Options.h +8 -65
- data/src/agent/Core/ApplicationPool/Pool.h +4 -21
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -60
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +10 -13
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +3 -8
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +2 -34
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Process.cpp +17 -12
- data/src/agent/Core/ApplicationPool/Process.h +146 -93
- data/src/agent/Core/ApplicationPool/Session.h +2 -2
- data/src/agent/Core/ApplicationPool/Socket.h +28 -27
- data/src/agent/Core/Config.h +1 -3
- data/src/agent/Core/ConfigChange.cpp +2 -4
- data/src/agent/Core/Controller.h +2 -8
- data/src/agent/Core/Controller/BufferBody.cpp +0 -2
- data/src/agent/Core/Controller/CheckoutSession.cpp +12 -24
- data/src/agent/Core/Controller/Config.h +1 -9
- data/src/agent/Core/Controller/ForwardResponse.cpp +0 -34
- data/src/agent/Core/Controller/Hooks.cpp +0 -7
- data/src/agent/Core/Controller/InitRequest.cpp +0 -43
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +0 -4
- data/src/agent/Core/Controller/Request.h +1 -35
- data/src/agent/Core/Controller/SendRequest.cpp +0 -32
- data/src/agent/Core/CoreMain.cpp +19 -32
- data/src/agent/Core/SpawningKit/Config.h +329 -55
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +369 -0
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +307 -0
- data/src/agent/Core/SpawningKit/Context.h +211 -0
- data/src/agent/Core/SpawningKit/DirectSpawner.h +112 -122
- data/src/agent/Core/SpawningKit/DummySpawner.h +59 -20
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +117 -0
- data/src/agent/Core/SpawningKit/Exceptions.h +1157 -0
- data/src/agent/Core/SpawningKit/Factory.h +24 -17
- data/src/agent/Core/SpawningKit/{BackgroundIOCapturer.h → Handshake/BackgroundIOCapturer.h} +48 -18
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +1650 -0
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +582 -0
- data/src/agent/Core/SpawningKit/Handshake/Session.h +91 -0
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +100 -0
- data/src/agent/Core/SpawningKit/Journey.h +561 -0
- data/src/agent/Core/SpawningKit/PipeWatcher.h +41 -18
- data/src/agent/Core/SpawningKit/README.md +534 -0
- data/src/agent/Core/SpawningKit/Result.h +182 -7
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +69 -0
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +110 -0
- data/src/agent/Core/SpawningKit/SmartSpawner.h +1027 -562
- data/src/agent/Core/SpawningKit/Spawner.h +70 -1134
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +3 -33
- data/src/agent/README.md +2 -3
- data/src/agent/Shared/ApiServerUtils.h +2 -3
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +932 -0
- data/src/agent/Watchdog/Config.h +1 -3
- data/src/agent/Watchdog/WatchdogMain.cpp +2 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +5 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +22 -13
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +5 -0
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +3 -0
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +13 -0
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +13 -0
- data/src/cxx_supportlib/Constants.h +3 -1
- data/src/cxx_supportlib/Exceptions.h +0 -121
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +7 -6
- data/src/cxx_supportlib/LoggingKit/Logging.h +3 -1
- data/src/cxx_supportlib/Utils.cpp +42 -0
- data/src/cxx_supportlib/Utils.h +7 -0
- data/src/cxx_supportlib/Utils/IOUtils.cpp +58 -0
- data/src/cxx_supportlib/Utils/IOUtils.h +13 -0
- data/src/cxx_supportlib/Utils/JsonUtils.h +130 -23
- data/src/cxx_supportlib/Utils/ScopeGuard.h +9 -4
- data/src/cxx_supportlib/Utils/StrIntUtils.cpp +7 -0
- data/src/cxx_supportlib/Utils/StrIntUtils.h +1 -0
- data/src/cxx_supportlib/Utils/SystemTime.h +1 -1
- data/src/cxx_supportlib/Utils/Timer.h +1 -1
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +6 -4
- data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -0
- data/src/helper-scripts/node-loader.js +54 -59
- data/src/helper-scripts/rack-loader.rb +63 -60
- data/src/helper-scripts/rack-preloader.rb +125 -72
- data/src/helper-scripts/wsgi-loader.py +100 -43
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +120 -112
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +15 -8
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +142 -142
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.c +26 -15
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.h +3 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +76 -70
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +114 -99
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +170 -156
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +38 -35
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +5 -1
- data/src/ruby_supportlib/phusion_passenger.rb +5 -5
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +14 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +8 -0
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +0 -3
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +0 -1
- data/src/ruby_supportlib/phusion_passenger/constants.rb +2 -0
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +646 -238
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +117 -95
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +0 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +5 -1
- data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +92 -69
- data/src/ruby_supportlib/phusion_passenger/public_api.rb +0 -17
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +0 -3
- data/src/ruby_supportlib/phusion_passenger/request_handler.rb +4 -5
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +0 -22
- metadata +64 -67
- data/resources/templates/error_layout.html.template +0 -86
- data/resources/templates/general_error.html.template +0 -1
- data/resources/templates/general_error_with_html.html.template +0 -1
- data/src/agent/Core/ApplicationPool/ErrorRenderer.h +0 -131
- data/src/agent/Core/SpawningKit/Options.h +0 -41
- data/src/agent/Core/UnionStation/Connection.h +0 -173
- data/src/agent/Core/UnionStation/Context.h +0 -536
- data/src/agent/Core/UnionStation/StopwatchLog.h +0 -147
- data/src/agent/Core/UnionStation/Transaction.h +0 -249
- data/src/agent/SpawnPreparer/SpawnPreparerMain.cpp +0 -208
- data/src/cxx_supportlib/UnionStationFilterSupport.cpp +0 -67
- data/src/cxx_supportlib/UnionStationFilterSupport.h +0 -1622
- data/src/nodejs_supportlib/phusion_passenger/log_express.js +0 -106
- data/src/nodejs_supportlib/phusion_passenger/log_mongodb.js +0 -202
- data/src/nodejs_supportlib/phusion_passenger/ustreporter.js +0 -227
- data/src/nodejs_supportlib/phusion_passenger/ustrouter_connector.js +0 -448
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/CONFIG.md +0 -37
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile +0 -17
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile.lock +0 -59
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README-API.md +0 -5
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README.md +0 -117
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Rakefile +0 -115
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +0 -423
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +0 -238
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/connection.rb +0 -67
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/context.rb +0 -281
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/lock.rb +0 -62
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/log.rb +0 -66
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/message_channel.rb +0 -157
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter.rb +0 -150
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/basics.rb +0 -199
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/controllers.rb +0 -187
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/misc.rb +0 -303
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/view_rendering.rb +0 -91
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_json.rb +0 -396
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/spec_helper.rb +0 -279
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/time_point.rb +0 -39
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb +0 -173
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/utils.rb +0 -177
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version.rb +0 -32
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +0 -44
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.example +0 -16
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +0 -20
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +0 -18
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/union_station_hooks_core.gemspec +0 -23
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile +0 -14
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile.lock +0 -45
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/LICENSE.md +0 -19
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/README.md +0 -104
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Rakefile +0 -160
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails.rb +0 -200
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_controller_extension.rb +0 -45
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_view_subscriber.rb +0 -55
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_record_subscriber.rb +0 -41
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_benchmarkable_extension.rb +0 -47
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_cache_subscriber.rb +0 -79
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/exception_logger.rb +0 -57
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version.rb +0 -32
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version_data.rb +0 -44
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/union_station_hooks_rails.gemspec +0 -34
@@ -106,6 +106,8 @@
|
|
106
106
|
PhusionPassenger.require_passenger_lib 'constants'
|
107
107
|
|
108
108
|
NGINX_CONFIGURATION_OPTIONS = [
|
109
|
+
###### Global configuration ######
|
110
|
+
|
109
111
|
{
|
110
112
|
:name => 'passenger_root',
|
111
113
|
:scope => :global,
|
@@ -292,6 +294,14 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
292
294
|
:type => :uinteger,
|
293
295
|
:dynamic_default => 'passenger_core_file_descriptor_ulimit'
|
294
296
|
},
|
297
|
+
{
|
298
|
+
:name => 'passenger_max_instances_per_app',
|
299
|
+
:scope => :global,
|
300
|
+
:context => [:main],
|
301
|
+
:type => :uinteger,
|
302
|
+
:default => 0,
|
303
|
+
:header => 'PASSENGER_MAX_PROCESSES'
|
304
|
+
},
|
295
305
|
{
|
296
306
|
:name => 'passenger_admin_panel_url',
|
297
307
|
:scope => :global,
|
@@ -320,15 +330,10 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
320
330
|
:context => [:main],
|
321
331
|
:struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
|
322
332
|
},
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
:default => false,
|
328
|
-
:function => 'passenger_enabled',
|
329
|
-
:field => 'enabled',
|
330
|
-
:header => nil
|
331
|
-
},
|
333
|
+
|
334
|
+
|
335
|
+
###### Per-application configuration ######
|
336
|
+
|
332
337
|
{
|
333
338
|
:name => 'passenger_ruby',
|
334
339
|
:scope => :application,
|
@@ -372,39 +377,12 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
372
377
|
:default => 1,
|
373
378
|
:header => 'PASSENGER_MIN_PROCESSES'
|
374
379
|
},
|
375
|
-
{
|
376
|
-
:name => 'passenger_max_instances_per_app',
|
377
|
-
:scope => :global,
|
378
|
-
:context => [:main],
|
379
|
-
:type => :uinteger,
|
380
|
-
:default => 0,
|
381
|
-
:header => 'PASSENGER_MAX_PROCESSES'
|
382
|
-
},
|
383
|
-
{
|
384
|
-
:name => 'passenger_max_requests',
|
385
|
-
:scope => :location,
|
386
|
-
:type => :uinteger,
|
387
|
-
:default => 0
|
388
|
-
},
|
389
380
|
{
|
390
381
|
:name => 'passenger_start_timeout',
|
391
382
|
:scope => :application,
|
392
|
-
:type => :
|
383
|
+
:type => :uinteger,
|
393
384
|
:default => DEFAULT_START_TIMEOUT / 1000
|
394
385
|
},
|
395
|
-
{
|
396
|
-
:name => 'passenger_base_uri',
|
397
|
-
:scope => :location,
|
398
|
-
:type => :string_array,
|
399
|
-
:field => 'base_uris',
|
400
|
-
:header => nil
|
401
|
-
},
|
402
|
-
{
|
403
|
-
:name => 'passenger_document_root',
|
404
|
-
:scope => :location,
|
405
|
-
:type => :string,
|
406
|
-
:header => nil
|
407
|
-
},
|
408
386
|
{
|
409
387
|
:name => 'passenger_user',
|
410
388
|
:scope => :application,
|
@@ -452,6 +430,93 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
452
430
|
:type => :integer,
|
453
431
|
:default => DEFAULT_MAX_PRELOADER_IDLE_TIME
|
454
432
|
},
|
433
|
+
{
|
434
|
+
:name => 'passenger_env_var',
|
435
|
+
:scope => :application,
|
436
|
+
:type => :string_keyval,
|
437
|
+
:field => 'env_vars',
|
438
|
+
:header => nil
|
439
|
+
},
|
440
|
+
{
|
441
|
+
:name => 'passenger_spawn_method',
|
442
|
+
:scope => :application,
|
443
|
+
:dynamic_default => "'smart' for Ruby apps, 'direct' for all other apps",
|
444
|
+
:type => :string
|
445
|
+
},
|
446
|
+
{
|
447
|
+
:name => 'passenger_load_shell_envvars',
|
448
|
+
:scope => :application,
|
449
|
+
:type => :flag,
|
450
|
+
:default => true
|
451
|
+
},
|
452
|
+
{
|
453
|
+
:name => 'passenger_max_request_queue_size',
|
454
|
+
:scope => :application,
|
455
|
+
:type => :uinteger,
|
456
|
+
:default => DEFAULT_MAX_REQUEST_QUEUE_SIZE
|
457
|
+
},
|
458
|
+
{
|
459
|
+
:name => 'passenger_app_type',
|
460
|
+
:scope => :application,
|
461
|
+
:type => :string,
|
462
|
+
:dynamic_default => 'Autodetected',
|
463
|
+
:header => nil
|
464
|
+
},
|
465
|
+
{
|
466
|
+
:name => 'passenger_startup_file',
|
467
|
+
:scope => :application,
|
468
|
+
:type => :string,
|
469
|
+
:dynamic_default => 'Autodetected'
|
470
|
+
},
|
471
|
+
{
|
472
|
+
:name => 'passenger_restart_dir',
|
473
|
+
:scope => :application,
|
474
|
+
:type => :string,
|
475
|
+
:default => 'tmp'
|
476
|
+
},
|
477
|
+
{
|
478
|
+
:name => 'passenger_abort_websockets_on_process_shutdown',
|
479
|
+
:scope => :application,
|
480
|
+
:type => :flag,
|
481
|
+
:default => true
|
482
|
+
},
|
483
|
+
{
|
484
|
+
:name => 'passenger_force_max_concurrent_requests_per_process',
|
485
|
+
:scope => :application,
|
486
|
+
:type => :integer,
|
487
|
+
:default => -1
|
488
|
+
},
|
489
|
+
|
490
|
+
###### Per-location/per-request configuration ######
|
491
|
+
|
492
|
+
{
|
493
|
+
:name => 'passenger_enabled',
|
494
|
+
:scope => :location,
|
495
|
+
:type => :flag,
|
496
|
+
:default => false,
|
497
|
+
:function => 'passenger_enabled',
|
498
|
+
:field => 'enabled',
|
499
|
+
:header => nil
|
500
|
+
},
|
501
|
+
{
|
502
|
+
:name => 'passenger_max_requests',
|
503
|
+
:scope => :location,
|
504
|
+
:type => :uinteger,
|
505
|
+
:default => 0
|
506
|
+
},
|
507
|
+
{
|
508
|
+
:name => 'passenger_base_uri',
|
509
|
+
:scope => :location,
|
510
|
+
:type => :string_array,
|
511
|
+
:field => 'base_uris',
|
512
|
+
:header => nil
|
513
|
+
},
|
514
|
+
{
|
515
|
+
:name => 'passenger_document_root',
|
516
|
+
:scope => :location,
|
517
|
+
:type => :string,
|
518
|
+
:header => nil
|
519
|
+
},
|
455
520
|
{
|
456
521
|
:name => 'passenger_ignore_headers',
|
457
522
|
:scope => :location,
|
@@ -461,13 +526,6 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
461
526
|
:post => '&ngx_http_upstream_ignore_headers_masks',
|
462
527
|
:auto_generate_nginx_tracking_code => false
|
463
528
|
},
|
464
|
-
{
|
465
|
-
:name => 'passenger_env_var',
|
466
|
-
:scope => :application,
|
467
|
-
:type => :string_keyval,
|
468
|
-
:field => 'env_vars',
|
469
|
-
:header => nil
|
470
|
-
},
|
471
529
|
{
|
472
530
|
:name => 'passenger_set_header',
|
473
531
|
:scope => :location,
|
@@ -551,49 +609,12 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
551
609
|
:default => false,
|
552
610
|
:field => 'upstream_config.intercept_errors'
|
553
611
|
},
|
554
|
-
{
|
555
|
-
:name => 'passenger_spawn_method',
|
556
|
-
:scope => :application,
|
557
|
-
:dynamic_default => "'smart' for Ruby apps, 'direct' for all other apps",
|
558
|
-
:type => :string
|
559
|
-
},
|
560
|
-
{
|
561
|
-
:name => 'passenger_load_shell_envvars',
|
562
|
-
:scope => :application,
|
563
|
-
:type => :flag,
|
564
|
-
:default => true
|
565
|
-
},
|
566
|
-
{
|
567
|
-
:name => 'passenger_max_request_queue_size',
|
568
|
-
:scope => :application,
|
569
|
-
:type => :uinteger,
|
570
|
-
:default => DEFAULT_MAX_REQUEST_QUEUE_SIZE
|
571
|
-
},
|
572
612
|
{
|
573
613
|
:name => 'passenger_request_queue_overflow_status_code',
|
574
614
|
:scope => :location,
|
575
615
|
:type => :integer,
|
576
616
|
:default => 503
|
577
617
|
},
|
578
|
-
{
|
579
|
-
:name => 'passenger_restart_dir',
|
580
|
-
:scope => :application,
|
581
|
-
:type => :string,
|
582
|
-
:default => 'tmp'
|
583
|
-
},
|
584
|
-
{
|
585
|
-
:name => 'passenger_app_type',
|
586
|
-
:scope => :application,
|
587
|
-
:type => :string,
|
588
|
-
:dynamic_default => 'Autodetected',
|
589
|
-
:header => nil
|
590
|
-
},
|
591
|
-
{
|
592
|
-
:name => 'passenger_startup_file',
|
593
|
-
:scope => :application,
|
594
|
-
:type => :string,
|
595
|
-
:dynamic_default => 'Autodetected'
|
596
|
-
},
|
597
618
|
{
|
598
619
|
:name => 'passenger_sticky_sessions',
|
599
620
|
:scope => :location,
|
@@ -611,20 +632,10 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
611
632
|
:scope => :location,
|
612
633
|
:type => :string
|
613
634
|
},
|
614
|
-
|
615
|
-
:name => 'passenger_abort_websockets_on_process_shutdown',
|
616
|
-
:scope => :application,
|
617
|
-
:type => :flag,
|
618
|
-
:default => true
|
619
|
-
},
|
620
|
-
{
|
621
|
-
:name => 'passenger_force_max_concurrent_requests_per_process',
|
622
|
-
:scope => :application,
|
623
|
-
:type => :integer,
|
624
|
-
:default => -1
|
625
|
-
},
|
635
|
+
|
626
636
|
|
627
637
|
###### Enterprise features (placeholders in OSS) ######
|
638
|
+
|
628
639
|
{
|
629
640
|
:context => [:main],
|
630
641
|
:name => 'passenger_fly_with',
|
@@ -690,8 +701,17 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
690
701
|
:function => 'passenger_enterprise_only',
|
691
702
|
:field => nil
|
692
703
|
},
|
704
|
+
{
|
705
|
+
:name => 'passenger_app_log_file',
|
706
|
+
:scope => :application,
|
707
|
+
:type => :string,
|
708
|
+
:function => 'passenger_enterprise_only',
|
709
|
+
:dynamic_default => 'passenger_log_file'
|
710
|
+
},
|
711
|
+
|
712
|
+
|
713
|
+
###### Aliases and backwards compatibility options ######
|
693
714
|
|
694
|
-
###### Aliases for backwards compatibility ######
|
695
715
|
{
|
696
716
|
:name => 'passenger_debug_log_file',
|
697
717
|
:alias_for => 'passenger_log_file'
|
@@ -713,7 +733,9 @@ NGINX_CONFIGURATION_OPTIONS = [
|
|
713
733
|
:alias_for => 'passenger_max_preloader_idle_time'
|
714
734
|
},
|
715
735
|
|
716
|
-
|
736
|
+
|
737
|
+
###### Deprecated/obsolete options ######
|
738
|
+
|
717
739
|
{
|
718
740
|
:name => 'rails_framework_spawner_idle_time',
|
719
741
|
:scope => :application,
|
@@ -104,7 +104,6 @@ module PhusionPassenger
|
|
104
104
|
'src/ruby_supportlib/phusion_passenger/vendor/*/.*',
|
105
105
|
'src/ruby_supportlib/phusion_passenger/vendor/*/hacking/**/*',
|
106
106
|
'src/ruby_supportlib/phusion_passenger/vendor/*/spec/**/*',
|
107
|
-
'src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/rails_test_apps/**/*',
|
108
107
|
'src/cxx_supportlib/vendor-copy/*/.*',
|
109
108
|
'packaging/**/*',
|
110
109
|
'test/**/*'
|
@@ -58,7 +58,11 @@ define 'apache2-dev' do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
on :debian do
|
61
|
-
|
61
|
+
if PlatformInfo::os_version >= '9.4'
|
62
|
+
apt_get_install "apache2-dev"
|
63
|
+
else
|
64
|
+
apt_get_install "apache2-threaded-dev"
|
65
|
+
end
|
62
66
|
end
|
63
67
|
on :mandriva do
|
64
68
|
urpmi "apache-devel"
|
@@ -23,8 +23,8 @@
|
|
23
23
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
24
|
# THE SOFTWARE.
|
25
25
|
|
26
|
-
require 'socket'
|
27
26
|
require 'tmpdir'
|
27
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
28
28
|
PhusionPassenger.require_passenger_lib 'utils'
|
29
29
|
PhusionPassenger.require_passenger_lib 'native_support'
|
30
30
|
|
@@ -34,58 +34,57 @@ module PhusionPassenger
|
|
34
34
|
module PreloaderSharedHelpers
|
35
35
|
extend self
|
36
36
|
|
37
|
-
def init(
|
37
|
+
def init(main_app)
|
38
|
+
options = LoaderSharedHelpers.init(main_app)
|
39
|
+
|
40
|
+
$0 = "#{SHORT_PROGRAM_NAME} AppPreloader: #{options['app_root']}"
|
41
|
+
|
38
42
|
if !Kernel.respond_to?(:fork)
|
39
43
|
message = "Smart spawning is not available on this Ruby " +
|
40
44
|
"implementation because it does not support `Kernel.fork`. "
|
41
|
-
|
45
|
+
case options['integration_mode']
|
46
|
+
when 'nginx'
|
42
47
|
message << "Please set `passenger_spawn_method` to `direct`."
|
43
|
-
|
48
|
+
when 'apache'
|
44
49
|
message << "Please set `PassengerSpawnMethod` to `direct`."
|
50
|
+
else
|
51
|
+
message << "Please set `spawn_method` to `direct`."
|
45
52
|
end
|
46
53
|
raise(message)
|
47
54
|
end
|
48
|
-
|
55
|
+
|
56
|
+
options
|
49
57
|
end
|
50
58
|
|
51
59
|
def accept_and_process_next_client(server_socket)
|
52
|
-
original_pid = Process.pid
|
53
60
|
client = server_socket.accept
|
54
61
|
client.binmode
|
55
62
|
begin
|
56
|
-
|
63
|
+
line = client.readline
|
57
64
|
rescue EOFError
|
58
65
|
return nil
|
59
66
|
end
|
60
|
-
if command !~ /\n\Z/
|
61
|
-
STDERR.puts "Command must end with a newline"
|
62
|
-
elsif command == "spawn\n"
|
63
|
-
while client.readline != "\n"
|
64
|
-
# Do nothing.
|
65
|
-
end
|
66
67
|
|
67
|
-
|
68
|
-
|
68
|
+
begin
|
69
|
+
doc = Utils::JSON.parse(line)
|
70
|
+
rescue RuntimeError => e
|
71
|
+
client.write(Utils::JSON.generate(
|
72
|
+
:result => 'error',
|
73
|
+
:message => "JSON parse error: #{e}"
|
74
|
+
))
|
75
|
+
end
|
69
76
|
|
70
|
-
|
71
|
-
|
72
|
-
$0 = "#{$0} (forking...)"
|
73
|
-
client.puts "OK"
|
74
|
-
client.puts Process.pid
|
75
|
-
client.flush
|
76
|
-
client.sync = true
|
77
|
-
return [:forked, client]
|
78
|
-
elsif defined?(NativeSupport)
|
79
|
-
NativeSupport.detach_process(pid)
|
80
|
-
else
|
81
|
-
Process.detach(pid)
|
82
|
-
end
|
77
|
+
if doc['command'] == 'spawn'
|
78
|
+
handle_spawn_command(client, doc)
|
83
79
|
else
|
84
|
-
|
80
|
+
client.write(Utils::JSON.generate(
|
81
|
+
:result => 'error',
|
82
|
+
:message => "Unknown command #{doc['command'].inspect}"
|
83
|
+
))
|
84
|
+
nil
|
85
85
|
end
|
86
|
-
return nil
|
87
86
|
ensure
|
88
|
-
if client
|
87
|
+
if client
|
89
88
|
begin
|
90
89
|
client.close
|
91
90
|
rescue Errno::EINVAL
|
@@ -95,55 +94,79 @@ module PhusionPassenger
|
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
98
|
-
def
|
99
|
-
|
100
|
-
|
101
|
-
|
97
|
+
def handle_spawn_command(client, doc)
|
98
|
+
work_dir = doc['work_dir']
|
99
|
+
LoaderSharedHelpers.record_journey_step_end('PRELOADER_PREPARATION',
|
100
|
+
'STEP_PERFORMED', work_dir)
|
101
|
+
LoaderSharedHelpers.record_journey_step_begin('PRELOADER_FORK_SUBPROCESS',
|
102
|
+
'STEP_IN_PROGRESS', work_dir)
|
102
103
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
# Improve copy-on-write friendliness.
|
105
|
+
GC.start
|
106
|
+
|
107
|
+
begin
|
108
|
+
pid = fork
|
109
|
+
rescue SystemCallError => e
|
110
|
+
LoaderSharedHelpers.record_journey_step_end('PRELOADER_FORK_SUBPROCESS',
|
111
|
+
'STEP_ERRORED', work_dir)
|
112
|
+
raise e
|
107
113
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
114
|
+
|
115
|
+
if pid.nil?
|
116
|
+
begin
|
117
|
+
$0 = "#{$0} (forking...)"
|
118
|
+
LoaderSharedHelpers.record_journey_step_end('PRELOADER_FORK_SUBPROCESS',
|
119
|
+
'STEP_PERFORMED', work_dir)
|
120
|
+
LoaderSharedHelpers.run_block_and_record_step_progress('PRELOADER_SEND_RESPONSE', work_dir) do
|
121
|
+
client.write(Utils::JSON.generate(
|
122
|
+
:result => 'ok',
|
123
|
+
:pid => Process.pid
|
124
|
+
))
|
125
|
+
end
|
126
|
+
LoaderSharedHelpers.record_journey_step_end('PRELOADER_FINISH',
|
127
|
+
'STEP_PERFORMED', work_dir)
|
128
|
+
[:forked, work_dir]
|
129
|
+
rescue Exception => e
|
130
|
+
STDERR.puts("Error: #{e}\n#{e.backtrace.join("\n")}")
|
131
|
+
exit!(1)
|
132
|
+
end
|
133
|
+
elsif defined?(NativeSupport)
|
134
|
+
NativeSupport.detach_process(pid)
|
111
135
|
else
|
112
|
-
|
113
|
-
socket_prefix = "PsgPreloader"
|
136
|
+
Process.detach(pid)
|
114
137
|
end
|
138
|
+
end
|
115
139
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
140
|
+
def advertise_sockets(_options, server)
|
141
|
+
json = {
|
142
|
+
:sockets => [
|
143
|
+
{
|
144
|
+
:name => 'main',
|
145
|
+
:address => "unix:#{server[1]}",
|
146
|
+
:protocol => 'preloader',
|
147
|
+
:concurrency => 1
|
148
|
+
}
|
149
|
+
]
|
150
|
+
}
|
125
151
|
|
126
|
-
|
127
|
-
|
128
|
-
|
152
|
+
File.open(ENV['PASSENGER_SPAWN_WORK_DIR'] + '/response/properties.json', 'w') do |f|
|
153
|
+
f.write(PhusionPassenger::Utils::JSON.generate(json))
|
154
|
+
end
|
155
|
+
end
|
129
156
|
|
130
|
-
|
131
|
-
|
132
|
-
|
157
|
+
def run_main_loop(server, options)
|
158
|
+
server_socket, socket_filename = server
|
159
|
+
original_pid = Process.pid
|
133
160
|
|
134
161
|
while true
|
135
162
|
# We call ::select just in case someone overwrites the global select()
|
136
163
|
# function by including ActionView::Helpers in the wrong place.
|
137
164
|
# https://code.google.com/p/phusion-passenger/issues/detail?id=915
|
138
|
-
ios = Kernel.select([
|
139
|
-
if ios.include?(
|
140
|
-
result,
|
165
|
+
ios = Kernel.select([server_socket, STDIN])[0]
|
166
|
+
if ios.include?(server_socket)
|
167
|
+
result, subprocess_work_dir = accept_and_process_next_client(server_socket)
|
141
168
|
if result == :forked
|
142
|
-
|
143
|
-
STDOUT.reopen(client)
|
144
|
-
STDOUT.sync = true
|
145
|
-
client.close
|
146
|
-
return :forked
|
169
|
+
return subprocess_work_dir
|
147
170
|
end
|
148
171
|
end
|
149
172
|
if ios.include?(STDIN)
|
@@ -158,9 +181,9 @@ module PhusionPassenger
|
|
158
181
|
break
|
159
182
|
end
|
160
183
|
end
|
161
|
-
|
184
|
+
nil
|
162
185
|
ensure
|
163
|
-
|
186
|
+
server_socket.close if server_socket
|
164
187
|
if original_pid == Process.pid
|
165
188
|
File.unlink(socket_filename) rescue nil
|
166
189
|
end
|