passenger 6.0.23 → 6.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG +26 -1
- data/Rakefile +7 -3
- data/bin/passenger-install-apache2-module +5 -0
- data/bin/passenger-install-nginx-module +17 -2
- data/build/apache2.rb +1 -1
- data/build/basics.rb +10 -4
- data/build/cxx_tests.rb +18 -7
- data/build/support/cxx_dependency_map.rb +40 -6
- data/build/test_basics.rb +4 -12
- data/package.json +1 -1
- data/passenger.gemspec +1 -1
- data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +10 -2
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +9 -0
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +9 -0
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +63 -50
- data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +19 -9
- data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group/Verification.cpp +8 -0
- data/src/agent/Core/ApplicationPool/Group.h +15 -5
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +11 -1
- data/src/agent/Core/ApplicationPool/Pool.h +0 -2
- data/src/agent/Core/ApplicationPool/Process.h +22 -6
- data/src/agent/Core/ApplicationPool/Session.h +6 -1
- data/src/agent/Core/Config.h +7 -3
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Core/CoreMain.cpp +10 -17
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -53
- data/src/agent/Core/SpawningKit/Handshake/Session.h +3 -0
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +5 -2
- data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -2
- data/src/agent/Core/SpawningKit/Spawner.h +4 -0
- data/src/agent/Shared/Fundamentals/AbortHandler.cpp +88 -9
- data/src/agent/Shared/Fundamentals/AbortHandler.h +2 -0
- data/src/agent/Shared/Fundamentals/Initialization.cpp +9 -3
- data/src/agent/Shared/Fundamentals/Initialization.h +3 -3
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +6 -7
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +4 -7
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +5 -3
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +3 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +3 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +2 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +2 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringMap.h +0 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
- data/src/cxx_supportlib/SafeLibev.h +1 -3
- data/src/cxx_supportlib/ServerKit/Hooks.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +0 -1
- data/src/cxx_supportlib/ServerKit/HttpServer.h +15 -10
- data/src/cxx_supportlib/ServerKit/Server.h +0 -6
- data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +2 -0
- data/src/cxx_supportlib/Utils/SpeedMeter.h +0 -3
- data/src/cxx_supportlib/oxt/implementation.cpp +11 -0
- data/src/cxx_supportlib/oxt/system_calls.cpp +10 -3
- data/src/cxx_supportlib/oxt/thread.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/as_tuple.hpp +35 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/associated_immediate_executor.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/associator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +74 -68
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +11 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +88 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +91 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +105 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/bind_immediate_executor.hpp +90 -23
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer_registration.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_after.hpp +303 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_at.hpp +296 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/impl/co_composed.hpp → co_composed.hpp} +208 -61
- data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +10 -201
- data/src/cxx_supportlib/vendor-modified/boost/asio/composed.hpp +415 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +214 -48
- data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +3 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/default_completion_token.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deferred.hpp +9 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detached.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_message.hpp → detail/completion_message.hpp} +14 -16
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_payload.hpp → detail/completion_payload.hpp} +30 -32
- data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_handler.hpp → detail/completion_payload_handler.hpp} +15 -13
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +26 -32
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +14 -118
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +36 -33
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +7 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +44 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/initiation_base.hpp +64 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +0 -11
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +20 -16
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +23 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/recycling_allocator.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_query_op.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timed_cancel_op.hpp +363 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +29 -51
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +2 -114
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_receive_op.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_functions.hpp +27 -19
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_op.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +17 -15
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/impl/channel_service.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +3 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +12 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +38 -40
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/immediate.hpp +144 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +45 -14
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/awaitable.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_after.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_at.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +60 -166
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/detached.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +14 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +26 -177
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +16 -82
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +13 -286
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +55 -18
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +26 -185
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +16 -87
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_context_strand.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +12 -6
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +127 -28
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +70 -20
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +114 -36
- data/src/cxx_supportlib/vendor-modified/boost/asio/redirect_error.hpp +43 -3
- data/src/cxx_supportlib/vendor-modified/boost/asio/registered_buffer.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +10 -7
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/asio/this_coro.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_awaitable.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/uses_executor.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +147 -35
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +74 -22
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/assert/source_location.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/futex.hpp +42 -11
- data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +15 -37
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +151 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +11 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +611 -102
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +47 -47
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +25 -24
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/allocation_type.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_list.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_slist.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +35 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +14 -14
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +55 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/function_detector.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_container.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_contiguous_container.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_pair.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/multiallocation_chain.hpp +96 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +19 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +17 -17
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_resource.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +86 -52
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/version_type.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +145 -65
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +105 -22
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +30 -22
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +19 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +15 -8
- data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +6 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +31 -24
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +45 -43
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +45 -33
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +5 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +55 -47
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +222 -73
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/minstd_rand.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +53 -5
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/pointer_in_range.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/span.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/type_name.hpp +7 -2
- data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +22 -34
- data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +141 -38
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/algorithm.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hash.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +18 -18
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +22 -17
- data/src/cxx_supportlib/vendor-modified/boost/libs/random/src/random_device.cpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/config_begin.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/launder.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/aux_/integral_wrapper.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/requires_cxx11.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/generic_category_message.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +22 -6
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +38 -10
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +111 -2
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/cumulative_stats.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +33 -7
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map_fwd.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set_fwd.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +17 -0
- data/src/cxx_supportlib/vendor-modified/boost/utility/detail/minstd_rand.hpp +1 -43
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +6 -2
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +10 -0
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +12 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +32 -5
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +0 -4
- data/src/ruby_supportlib/phusion_passenger/utils/json.rb +5 -1
- data/src/ruby_supportlib/phusion_passenger/utils.rb +5 -15
- data/src/ruby_supportlib/phusion_passenger.rb +5 -5
- metadata +21 -8
data/src/agent/Core/Config.h
CHANGED
@@ -167,13 +167,13 @@ using namespace std;
|
|
167
167
|
* security_update_checker_interval unsigned integer - default(86400)
|
168
168
|
* security_update_checker_proxy_url string - -
|
169
169
|
* security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
|
170
|
-
* server_software string - default("Phusion_Passenger/6.0.
|
170
|
+
* server_software string - default("Phusion_Passenger/6.0.24")
|
171
171
|
* show_version_in_header boolean - default(true)
|
172
172
|
* single_app_mode_app_root string - default,read_only
|
173
173
|
* single_app_mode_app_start_command string - read_only
|
174
174
|
* single_app_mode_app_type string - read_only
|
175
175
|
* single_app_mode_startup_file string - read_only
|
176
|
-
* spawn_dir string
|
176
|
+
* spawn_dir string - default,read_only
|
177
177
|
* standalone_engine string - default
|
178
178
|
* stat_throttle_rate unsigned integer - default(10)
|
179
179
|
* telemetry_collector_ca_certificate_path string - -
|
@@ -240,6 +240,10 @@ private:
|
|
240
240
|
return 80;
|
241
241
|
}
|
242
242
|
|
243
|
+
static Json::Value getDefaultSpawnDir(const ConfigKit::Store &store) {
|
244
|
+
return getSystemTempDir();
|
245
|
+
}
|
246
|
+
|
243
247
|
static Json::Value getDefaultThreads(const ConfigKit::Store &store) {
|
244
248
|
return Json::UInt(boost::thread::hardware_concurrency());
|
245
249
|
}
|
@@ -488,7 +492,7 @@ public:
|
|
488
492
|
overrideWithDynamicDefault("default_server_port", UINT_TYPE, OPTIONAL, getDefaultServerPort);
|
489
493
|
|
490
494
|
add("passenger_root", STRING_TYPE, REQUIRED | READ_ONLY);
|
491
|
-
|
495
|
+
addWithDynamicDefault("spawn_dir", STRING_TYPE, OPTIONAL | READ_ONLY | CACHE_DEFAULT_VALUE, getDefaultSpawnDir);
|
492
496
|
add("config_manifest", OBJECT_TYPE, OPTIONAL | READ_ONLY);
|
493
497
|
add("pid_file", STRING_TYPE, OPTIONAL | READ_ONLY);
|
494
498
|
add("web_server_version", STRING_TYPE, OPTIONAL | READ_ONLY);
|
@@ -117,7 +117,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
|
|
117
117
|
* multi_app boolean - default(true),read_only
|
118
118
|
* request_freelist_limit unsigned integer - default(1024)
|
119
119
|
* response_buffer_high_watermark unsigned integer - default(134217728)
|
120
|
-
* server_software string - default("Phusion_Passenger/6.0.
|
120
|
+
* server_software string - default("Phusion_Passenger/6.0.24")
|
121
121
|
* show_version_in_header boolean - default(true)
|
122
122
|
* start_reading_after_accept boolean - default(true)
|
123
123
|
* stat_throttle_rate unsigned integer - default(10)
|
data/src/agent/Core/CoreMain.cpp
CHANGED
@@ -85,7 +85,6 @@
|
|
85
85
|
#include <AppTypeDetector/Detector.h>
|
86
86
|
#include <IOTools/MessageSerialization.h>
|
87
87
|
#include <FileDescriptor.h>
|
88
|
-
#include <ResourceLocator.h>
|
89
88
|
#include <BackgroundEventLoop.cpp>
|
90
89
|
#include <FileTools/FileManip.h>
|
91
90
|
#include <FileTools/PathSecurityCheck.h>
|
@@ -145,7 +144,6 @@ namespace Core {
|
|
145
144
|
|
146
145
|
boost::mutex configSyncher;
|
147
146
|
|
148
|
-
ResourceLocator resourceLocator;
|
149
147
|
RandomGeneratorPtr randomGenerator;
|
150
148
|
SpawningKit::Context::Schema spawningKitContextSchema;
|
151
149
|
SpawningKit::ContextPtr spawningKitContext;
|
@@ -697,8 +695,6 @@ initializeNonPrivilegedWorkingObjects() {
|
|
697
695
|
|
698
696
|
setenv("SERVER_SOFTWARE", coreConfig->get("server_software").asCString(), 1);
|
699
697
|
|
700
|
-
wo->resourceLocator = ResourceLocator(coreConfig->get("passenger_root").asString());
|
701
|
-
|
702
698
|
wo->randomGenerator = boost::make_shared<RandomGenerator>();
|
703
699
|
// Check whether /dev/urandom is actually random.
|
704
700
|
// https://code.google.com/p/phusion-passenger/issues/detail?id=516
|
@@ -710,7 +706,7 @@ initializeNonPrivilegedWorkingObjects() {
|
|
710
706
|
UPDATE_TRACE_POINT();
|
711
707
|
wo->spawningKitContext = boost::make_shared<SpawningKit::Context>(
|
712
708
|
wo->spawningKitContextSchema);
|
713
|
-
wo->spawningKitContext->resourceLocator =
|
709
|
+
wo->spawningKitContext->resourceLocator = Agent::Fundamentals::context->resourceLocator;
|
714
710
|
wo->spawningKitContext->wrapperRegistry = coreWrapperRegistry;
|
715
711
|
wo->spawningKitContext->randomGenerator = wo->randomGenerator;
|
716
712
|
wo->spawningKitContext->integrationMode = coreConfig->get("integration_mode").asString();
|
@@ -772,7 +768,7 @@ initializeNonPrivilegedWorkingObjects() {
|
|
772
768
|
&coreSchema->controllerSingleAppMode.schema,
|
773
769
|
&wo->singleAppModeConfig,
|
774
770
|
coreSchema->controllerSingleAppMode.translator);
|
775
|
-
two.controller->resourceLocator =
|
771
|
+
two.controller->resourceLocator = Agent::Fundamentals::context->resourceLocator;
|
776
772
|
two.controller->wrapperRegistry = coreWrapperRegistry;
|
777
773
|
two.controller->appPool = wo->appPool;
|
778
774
|
two.controller->shutdownFinishCallback = controllerShutdownFinished;
|
@@ -877,7 +873,7 @@ initializeSecurityUpdateChecker() {
|
|
877
873
|
config,
|
878
874
|
coreSchema->securityUpdateChecker.translator);
|
879
875
|
workingObjects->securityUpdateChecker = checker;
|
880
|
-
checker->resourceLocator =
|
876
|
+
checker->resourceLocator = Agent::Fundamentals::context->resourceLocator;
|
881
877
|
checker->initialize();
|
882
878
|
checker->start();
|
883
879
|
}
|
@@ -927,7 +923,7 @@ initializeAdminPanelConnector() {
|
|
927
923
|
AdminPanelConnector *connector = new Core::AdminPanelConnector(
|
928
924
|
coreSchema->adminPanelConnector.schema, config,
|
929
925
|
coreSchema->adminPanelConnector.translator);
|
930
|
-
connector->resourceLocator =
|
926
|
+
connector->resourceLocator = Agent::Fundamentals::context->resourceLocator;
|
931
927
|
connector->appPool = wo.appPool;
|
932
928
|
connector->configGetter = inspectConfig;
|
933
929
|
for (unsigned int i = 0; i < wo.threadWorkingObjects.size(); i++) {
|
@@ -956,7 +952,7 @@ prestartWebApps() {
|
|
956
952
|
}
|
957
953
|
|
958
954
|
boost::function<void ()> func = boost::bind(prestartWebApps,
|
959
|
-
|
955
|
+
*Agent::Fundamentals::context->resourceLocator,
|
960
956
|
coreConfig->get("default_ruby").asString(),
|
961
957
|
prestartURLs
|
962
958
|
);
|
@@ -983,7 +979,7 @@ warnIfPassengerRootVulnerable() {
|
|
983
979
|
return; // Passenger is not root, so no escalation.
|
984
980
|
}
|
985
981
|
|
986
|
-
string root =
|
982
|
+
string root = Agent::Fundamentals::context->resourceLocator->getInstallSpec();
|
987
983
|
vector<string> errors, checkErrors;
|
988
984
|
if (isPathProbablySecureForRootUse(root, errors, checkErrors)) {
|
989
985
|
if (!checkErrors.empty()) {
|
@@ -1400,13 +1396,10 @@ parseOptions(int argc, const char *argv[], ConfigKit::Store &config) {
|
|
1400
1396
|
}
|
1401
1397
|
}
|
1402
1398
|
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
ConfigKit::toString(errors) << "\n"
|
1408
|
-
"Raw initial configuration: " << updates.toStyledString());
|
1409
|
-
}
|
1399
|
+
vector<ConfigKit::Error> errors;
|
1400
|
+
if (!config.update(updates, errors)) {
|
1401
|
+
P_ERROR("*** Error in options: " << ConfigKit::toString(errors));
|
1402
|
+
std::exit(1);
|
1410
1403
|
}
|
1411
1404
|
}
|
1412
1405
|
|
@@ -30,9 +30,7 @@
|
|
30
30
|
#include <boost/thread.hpp>
|
31
31
|
#include <boost/scoped_array.hpp>
|
32
32
|
#include <string>
|
33
|
-
#include <
|
34
|
-
#include <stdexcept>
|
35
|
-
#include <algorithm>
|
33
|
+
#include <exception>
|
36
34
|
#include <utility>
|
37
35
|
#include <cerrno>
|
38
36
|
#include <cstddef>
|
@@ -45,7 +43,6 @@
|
|
45
43
|
#include <pwd.h>
|
46
44
|
#include <grp.h>
|
47
45
|
#include <unistd.h>
|
48
|
-
#include <limits.h>
|
49
46
|
|
50
47
|
#include <jsoncpp/json.h>
|
51
48
|
|
@@ -350,55 +347,6 @@ private:
|
|
350
347
|
}
|
351
348
|
}
|
352
349
|
|
353
|
-
#if 0
|
354
|
-
void inferApplicationInfo() const {
|
355
|
-
TRACE_POINT();
|
356
|
-
session.result.codeRevision = readFromRevisionFile();
|
357
|
-
if (session.result.codeRevision.empty()) {
|
358
|
-
session.result.codeRevision = inferCodeRevisionFromCapistranoSymlink();
|
359
|
-
}
|
360
|
-
}
|
361
|
-
|
362
|
-
string readFromRevisionFile() const {
|
363
|
-
TRACE_POINT();
|
364
|
-
string filename = config->appRoot + "/REVISION";
|
365
|
-
try {
|
366
|
-
if (fileExists(filename)) {
|
367
|
-
return strip(readAll(filename));
|
368
|
-
}
|
369
|
-
} catch (const SystemException &e) {
|
370
|
-
P_WARN("Cannot access " << filename << ": " << e.what());
|
371
|
-
}
|
372
|
-
return string();
|
373
|
-
}
|
374
|
-
|
375
|
-
string inferCodeRevisionFromCapistranoSymlink() const {
|
376
|
-
TRACE_POINT();
|
377
|
-
if (extractBaseName(config->appRoot) == "current") {
|
378
|
-
string appRoot = config->appRoot.toString(); // null terminate string
|
379
|
-
char buf[PATH_MAX + 1];
|
380
|
-
ssize_t ret;
|
381
|
-
|
382
|
-
do {
|
383
|
-
ret = readlink(appRoot.c_str(), buf, PATH_MAX);
|
384
|
-
} while (ret == -1 && errno == EINTR);
|
385
|
-
if (ret == -1) {
|
386
|
-
if (errno == EINVAL) {
|
387
|
-
return string();
|
388
|
-
} else {
|
389
|
-
int e = errno;
|
390
|
-
P_WARN("Cannot read symlink " << appRoot << ": " << strerror(e));
|
391
|
-
}
|
392
|
-
}
|
393
|
-
|
394
|
-
buf[ret] = '\0';
|
395
|
-
return extractBaseName(buf);
|
396
|
-
} else {
|
397
|
-
return string();
|
398
|
-
}
|
399
|
-
}
|
400
|
-
#endif
|
401
|
-
|
402
350
|
void findFreePortOrSocketFile() {
|
403
351
|
TRACE_POINT();
|
404
352
|
session.expectedStartPort = findFreePort();
|
@@ -31,11 +31,12 @@
|
|
31
31
|
#include <cerrno>
|
32
32
|
|
33
33
|
#include <sys/types.h>
|
34
|
-
#include <limits.h>
|
34
|
+
#include <limits.h> // IWYU pragma: keep; for PATH_MAX
|
35
35
|
#include <unistd.h>
|
36
36
|
|
37
37
|
#include <Exceptions.h>
|
38
38
|
#include <Utils.h>
|
39
|
+
#include <FileTools/FileManip.h>
|
39
40
|
#include <StrIntTools/StrIntUtils.h>
|
40
41
|
|
41
42
|
namespace Passenger {
|
@@ -78,6 +79,8 @@ public:
|
|
78
79
|
|
79
80
|
~HandshakeWorkDir() {
|
80
81
|
if (!path.empty()) {
|
82
|
+
boost::this_thread::disable_interruption di;
|
83
|
+
boost::this_thread::disable_syscall_interruption dsi;
|
81
84
|
removeDirTree(path);
|
82
85
|
}
|
83
86
|
}
|
@@ -108,7 +111,7 @@ public:
|
|
108
111
|
// dropping root privileges).
|
109
112
|
boost::this_thread::disable_interruption di;
|
110
113
|
boost::this_thread::disable_syscall_interruption dsi;
|
111
|
-
syscalls::chown(path.c_str(), uid, gid);
|
114
|
+
oxt::syscalls::chown(path.c_str(), uid, gid);
|
112
115
|
}
|
113
116
|
};
|
114
117
|
|
@@ -33,12 +33,12 @@
|
|
33
33
|
#include <string>
|
34
34
|
#include <vector>
|
35
35
|
#include <map>
|
36
|
-
#include <
|
36
|
+
#include <exception>
|
37
37
|
#include <dirent.h>
|
38
38
|
#include <sys/types.h>
|
39
39
|
#include <sys/wait.h>
|
40
40
|
#include <sys/stat.h>
|
41
|
-
#include <signal.h>
|
41
|
+
#include <signal.h> // IWYU pragma: keep; for signal constants
|
42
42
|
#include <unistd.h>
|
43
43
|
#include <cstring>
|
44
44
|
#include <cassert>
|
@@ -66,6 +66,10 @@
|
|
66
66
|
#include <Core/SpawningKit/Handshake/Perform.h>
|
67
67
|
#include <Core/SpawningKit/Handshake/BackgroundIOCapturer.h>
|
68
68
|
|
69
|
+
#ifdef INTELLISENSE
|
70
|
+
#include <Core/ApplicationPool/Options.h>
|
71
|
+
#endif
|
72
|
+
|
69
73
|
namespace Passenger {
|
70
74
|
namespace SpawningKit {
|
71
75
|
|
@@ -29,13 +29,13 @@
|
|
29
29
|
#include <boost/cstdint.hpp>
|
30
30
|
#include <sys/types.h>
|
31
31
|
#include <sys/stat.h>
|
32
|
+
#include <sys/wait.h>
|
32
33
|
#include <sys/select.h>
|
33
34
|
#include <cstdio>
|
34
35
|
#include <cstdlib>
|
35
36
|
#include <cstddef>
|
36
37
|
#include <cstring>
|
37
38
|
#include <cerrno>
|
38
|
-
#include <cassert>
|
39
39
|
#include <fcntl.h>
|
40
40
|
#include <poll.h>
|
41
41
|
#include <unistd.h>
|
@@ -121,8 +121,6 @@ typedef void (*Callback)(AbortHandlerWorkingState &state, void *userData);
|
|
121
121
|
|
122
122
|
|
123
123
|
static AbortHandlerContext *ctx = NULL;
|
124
|
-
static const char digits[] = "0123456789";
|
125
|
-
static const char hex_chars[] = "0123456789abcdef";
|
126
124
|
|
127
125
|
|
128
126
|
static void
|
@@ -269,6 +267,65 @@ appendSignalReason(char *buf, const char *end, siginfo_t *info) {
|
|
269
267
|
return buf;
|
270
268
|
}
|
271
269
|
|
270
|
+
static bool
|
271
|
+
resumeOriginalProcess(AbortHandlerWorkingState &state) {
|
272
|
+
const char *end = state.messageBuf + sizeof(state.messageBuf);
|
273
|
+
char *pos = state.messageBuf;
|
274
|
+
pos = ASSU::appendData(pos, end, state.messagePrefix);
|
275
|
+
pos = ASSU::appendData(pos, end, " ] Triggering original signal handler");
|
276
|
+
pos = ASSU::appendData(pos, end, "\n");
|
277
|
+
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
278
|
+
|
279
|
+
int e = kill(state.pid, SIGCONT);
|
280
|
+
if (e == -1) {
|
281
|
+
int e = errno;
|
282
|
+
pos = state.messageBuf;
|
283
|
+
pos = ASSU::appendData(pos, end, state.messagePrefix);
|
284
|
+
pos = ASSU::appendData(pos, end, " ] Could not resume original process: kill() failed: ");
|
285
|
+
pos = ASSU::appendData(pos, end, ASSU::limitedStrerror(e));
|
286
|
+
pos = ASSU::appendData(pos, end, " (errno=");
|
287
|
+
pos = ASSU::appendInteger<int, 10>(pos, end, e);
|
288
|
+
pos = ASSU::appendData(pos, end, ")\n");
|
289
|
+
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
290
|
+
|
291
|
+
return false;
|
292
|
+
} {
|
293
|
+
return true;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
static void
|
298
|
+
forceTerminateOriginalProcess(AbortHandlerWorkingState &state) {
|
299
|
+
const char *end = state.messageBuf + sizeof(state.messageBuf);
|
300
|
+
char *pos = state.messageBuf;
|
301
|
+
pos = ASSU::appendData(pos, end, state.messagePrefix);
|
302
|
+
pos = ASSU::appendData(pos, end, " ] Force terminating original process");
|
303
|
+
pos = ASSU::appendData(pos, end, "\n");
|
304
|
+
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
305
|
+
|
306
|
+
int ret = kill(state.pid, SIGKILL);
|
307
|
+
if (ret == -1) {
|
308
|
+
int e = errno;
|
309
|
+
pos = state.messageBuf;
|
310
|
+
pos = ASSU::appendData(pos, end, state.messagePrefix);
|
311
|
+
pos = ASSU::appendData(pos, end, " ] Could not force terminate original process: kill() failed: ");
|
312
|
+
pos = ASSU::appendData(pos, end, ASSU::limitedStrerror(e));
|
313
|
+
pos = ASSU::appendData(pos, end, " (errno=");
|
314
|
+
pos = ASSU::appendInteger<int, 10>(pos, end, e);
|
315
|
+
pos = ASSU::appendData(pos, end, ")\n");
|
316
|
+
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
317
|
+
}
|
318
|
+
}
|
319
|
+
|
320
|
+
static void
|
321
|
+
resumeOrForceTerminateOriginalProcess(AbortHandlerWorkingState &state) {
|
322
|
+
if (ctx->config->forceTerminateProcess) {
|
323
|
+
forceTerminateOriginalProcess(state);
|
324
|
+
} else if (!resumeOriginalProcess(state)) {
|
325
|
+
forceTerminateOriginalProcess(state);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
272
329
|
static int
|
273
330
|
runInSubprocessWithTimeLimit(AbortHandlerWorkingState &state, Callback callback, void *userData, int timeLimit) {
|
274
331
|
char *pos;
|
@@ -633,11 +690,25 @@ dumpWithCrashWatch(AbortHandlerWorkingState &state) {
|
|
633
690
|
close(p[0]);
|
634
691
|
backtrace_symbols_fd(backtraceStore, frames, p[1]);
|
635
692
|
close(p[1]);
|
636
|
-
|
693
|
+
|
694
|
+
int ret = waitpid(pid, &status, 0);
|
695
|
+
if (ret == -1 || status != 0) {
|
696
|
+
int e = errno;
|
637
697
|
pos = state.messageBuf;
|
638
698
|
pos = ASSU::appendData(pos, end, "ERROR: cannot execute '");
|
639
699
|
pos = ASSU::appendData(pos, end, ctx->backtraceSanitizerCommand);
|
640
|
-
pos = ASSU::appendData(pos, end, "' for sanitizing the backtrace
|
700
|
+
pos = ASSU::appendData(pos, end, "' for sanitizing the backtrace (");
|
701
|
+
if (ret == -1) {
|
702
|
+
pos = ASSU::appendData(pos, end, "waitpid() failed, errno=");
|
703
|
+
pos = ASSU::appendInteger<int, 10>(pos, end, e);
|
704
|
+
} else if (WIFSIGNALED(status)) {
|
705
|
+
pos = ASSU::appendData(pos, end, "exited with signal ");
|
706
|
+
pos = ASSU::appendInteger<int, 10>(pos, end, WTERMSIG(status));
|
707
|
+
} else {
|
708
|
+
pos = ASSU::appendData(pos, end, "exit status ");
|
709
|
+
pos = ASSU::appendInteger<int, 10>(pos, end, WEXITSTATUS(status));
|
710
|
+
}
|
711
|
+
pos = ASSU::appendData(pos, end, "), writing to stderr directly...\n");
|
641
712
|
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
642
713
|
backtrace_symbols_fd(backtraceStore, frames, STDERR_FILENO);
|
643
714
|
}
|
@@ -1083,19 +1154,19 @@ abortHandler(int signo, siginfo_t *info, void *_unused) {
|
|
1083
1154
|
// with SIGPIPE as a result, so we ignore SIGPIPE again.
|
1084
1155
|
ignoreSigpipe();
|
1085
1156
|
dumpDiagnostics(state);
|
1086
|
-
|
1087
|
-
// We do it ourselves just to be sure.
|
1088
|
-
kill(state.pid, SIGCONT);
|
1157
|
+
resumeOrForceTerminateOriginalProcess(state);
|
1089
1158
|
_exit(0);
|
1090
1159
|
|
1091
1160
|
} else if (child == -1) {
|
1092
1161
|
int e = errno;
|
1093
1162
|
pos = state.messageBuf;
|
1094
1163
|
pos = ASSU::appendData(pos, end, state.messagePrefix);
|
1095
|
-
pos = ASSU::appendData(pos, end, "] Could not fork a child process for dumping diagnostics: fork() failed with errno=");
|
1164
|
+
pos = ASSU::appendData(pos, end, " ] Could not fork a child process for dumping diagnostics: fork() failed with errno=");
|
1096
1165
|
pos = ASSU::appendInteger<int, 10>(pos, end, e);
|
1097
1166
|
pos = ASSU::appendData(pos, end, "\n");
|
1098
1167
|
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
1168
|
+
|
1169
|
+
resumeOrForceTerminateOriginalProcess(state);
|
1099
1170
|
_exit(1);
|
1100
1171
|
|
1101
1172
|
} else {
|
@@ -1112,6 +1183,8 @@ abortHandler(int signo, siginfo_t *info, void *_unused) {
|
|
1112
1183
|
pos = ASSU::appendData(pos, end, "\n");
|
1113
1184
|
write_nowarn(STDERR_FILENO, state.messageBuf, pos - state.messageBuf);
|
1114
1185
|
|
1186
|
+
resumeOrForceTerminateOriginalProcess(state);
|
1187
|
+
|
1115
1188
|
} else {
|
1116
1189
|
raise(SIGSTOP);
|
1117
1190
|
// Will continue after the child process has done its job.
|
@@ -1208,6 +1281,12 @@ abortHandlerConfigChanged() {
|
|
1208
1281
|
char *oldCrashWatchCommand = ctx->crashWatchCommand;
|
1209
1282
|
char *oldBacktraceSanitizerCommand = ctx->backtraceSanitizerCommand;
|
1210
1283
|
|
1284
|
+
if (config->origArgv == NULL) {
|
1285
|
+
fprintf(stderr, "AbortHandler requires config->origArgv!\n");
|
1286
|
+
fflush(stderr);
|
1287
|
+
abort();
|
1288
|
+
}
|
1289
|
+
|
1211
1290
|
if (config->resourceLocator != NULL) {
|
1212
1291
|
string path;
|
1213
1292
|
const ResourceLocator *locator = config->resourceLocator;
|
@@ -62,6 +62,7 @@ struct AbortHandlerConfig {
|
|
62
62
|
bool dumpWithCrashWatch;
|
63
63
|
bool beep;
|
64
64
|
bool stopProcess;
|
65
|
+
bool forceTerminateProcess;
|
65
66
|
ResourceLocator *resourceLocator;
|
66
67
|
DiagnosticsDumper diagnosticsDumpers[MAX_DIAGNOSTICS_DUMPERS];
|
67
68
|
|
@@ -72,6 +73,7 @@ struct AbortHandlerConfig {
|
|
72
73
|
dumpWithCrashWatch(false),
|
73
74
|
beep(false),
|
74
75
|
stopProcess(false),
|
76
|
+
forceTerminateProcess(false),
|
75
77
|
resourceLocator(NULL)
|
76
78
|
{ }
|
77
79
|
};
|
@@ -38,9 +38,8 @@
|
|
38
38
|
#include <vector>
|
39
39
|
|
40
40
|
#include <sys/types.h>
|
41
|
-
#include <stdlib.h>
|
41
|
+
#include <stdlib.h>
|
42
42
|
#include <unistd.h>
|
43
|
-
#include <signal.h>
|
44
43
|
#include <cstdio>
|
45
44
|
#include <cstdlib>
|
46
45
|
#include <cstring>
|
@@ -468,6 +467,7 @@ maybeInitializeAbortHandler() {
|
|
468
467
|
config->dumpWithCrashWatch = getEnvBool("PASSENGER_DUMP_WITH_CRASH_WATCH", true);
|
469
468
|
config->beep = getEnvBool("PASSENGER_BEEP_ON_ABORT");
|
470
469
|
config->stopProcess = getEnvBool("PASSENGER_STOP_ON_ABORT");
|
470
|
+
config->forceTerminateProcess = getEnvBool("PASSENGER_FORCE_TERMINATE_ON_ABORT");
|
471
471
|
|
472
472
|
installAbortHandler(config);
|
473
473
|
}
|
@@ -525,6 +525,12 @@ storeArgvCopy(int argc, char *argv[]) {
|
|
525
525
|
for (int i = 0; i < argc; i++) {
|
526
526
|
context->origArgv[i] = strdup(argv[i]);
|
527
527
|
}
|
528
|
+
|
529
|
+
if (abortHandlerInstalled()) {
|
530
|
+
// Let AbortHandler use the copy.
|
531
|
+
context->abortHandlerConfig.origArgv = context->origArgv;
|
532
|
+
abortHandlerConfigChanged();
|
533
|
+
}
|
528
534
|
}
|
529
535
|
|
530
536
|
static void
|
@@ -558,7 +564,7 @@ initializeAgent(int argc, char **argv[], const char *processName,
|
|
558
564
|
{
|
559
565
|
const char *seedStr;
|
560
566
|
|
561
|
-
context = new Context();
|
567
|
+
context = new Context(argc, *argv);
|
562
568
|
|
563
569
|
seedStr = getEnvString("PASSENGER_RANDOM_SEED");
|
564
570
|
if (seedStr == NULL) {
|
@@ -48,11 +48,11 @@ struct Context {
|
|
48
48
|
bool feedbackFdAvailable;
|
49
49
|
AbortHandlerConfig abortHandlerConfig;
|
50
50
|
|
51
|
-
Context()
|
51
|
+
Context(int argc, char *argv[])
|
52
52
|
: resourceLocator(NULL),
|
53
53
|
randomSeed(0),
|
54
|
-
origArgc(
|
55
|
-
origArgv(
|
54
|
+
origArgc(argc),
|
55
|
+
origArgv(argv),
|
56
56
|
feedbackFdAvailable(false)
|
57
57
|
{ }
|
58
58
|
};
|
@@ -36,8 +36,7 @@
|
|
36
36
|
#include <cstdlib>
|
37
37
|
#include <cstring>
|
38
38
|
#include <cerrno>
|
39
|
-
#include <
|
40
|
-
#include <stdexcept>
|
39
|
+
#include <exception>
|
41
40
|
#include <string>
|
42
41
|
#include <vector>
|
43
42
|
|
@@ -47,7 +46,7 @@
|
|
47
46
|
#include <sys/time.h>
|
48
47
|
#include <sys/resource.h>
|
49
48
|
#include <sys/stat.h>
|
50
|
-
#include <limits.h>
|
49
|
+
#include <limits.h> // IWYU pragma: keep (for PATH_MAX)
|
51
50
|
#include <unistd.h>
|
52
51
|
#include <pwd.h>
|
53
52
|
#include <grp.h>
|
@@ -218,8 +217,8 @@ dumpEnvvars(const string &workDir) {
|
|
218
217
|
NULL
|
219
218
|
};
|
220
219
|
SubprocessInfo info;
|
221
|
-
|
222
|
-
|
220
|
+
int fd = fileno(f);
|
221
|
+
runCommand(command, info, true, true, [=]() { reopenStdout(fd); });
|
223
222
|
fclose(f);
|
224
223
|
}
|
225
224
|
|
@@ -237,8 +236,8 @@ dumpUserInfo(const string &workDir) {
|
|
237
236
|
NULL
|
238
237
|
};
|
239
238
|
SubprocessInfo info;
|
240
|
-
|
241
|
-
|
239
|
+
int fd = fileno(f);
|
240
|
+
runCommand(command, info, true, true, [=]() { reopenStdout(fd); });
|
242
241
|
fclose(f);
|
243
242
|
}
|
244
243
|
|
data/src/agent/Watchdog/Config.h
CHANGED
@@ -155,7 +155,7 @@ using namespace std;
|
|
155
155
|
* security_update_checker_interval unsigned integer - default(86400)
|
156
156
|
* security_update_checker_proxy_url string - -
|
157
157
|
* security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
|
158
|
-
* server_software string - default("Phusion_Passenger/6.0.
|
158
|
+
* server_software string - default("Phusion_Passenger/6.0.24")
|
159
159
|
* setsid boolean - default(false)
|
160
160
|
* show_version_in_header boolean - default(true)
|
161
161
|
* single_app_mode_app_root string - default,read_only
|
@@ -836,13 +836,10 @@ parseOptions(int argc, const char *argv[], ConfigKit::Store &config) {
|
|
836
836
|
}
|
837
837
|
}
|
838
838
|
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
ConfigKit::toString(errors) << "\n"
|
844
|
-
"Raw initial configuration: " << updates.toStyledString());
|
845
|
-
}
|
839
|
+
vector<ConfigKit::Error> errors;
|
840
|
+
if (!config.update(updates, errors)) {
|
841
|
+
P_ERROR("*** Error in options: " << ConfigKit::toString(errors));
|
842
|
+
std::exit(1);
|
846
843
|
}
|
847
844
|
}
|
848
845
|
|
@@ -632,8 +632,10 @@ public:
|
|
632
632
|
} // namespace Apache2Module
|
633
633
|
} // namespace Passenger
|
634
634
|
|
635
|
-
#
|
636
|
-
#include "../
|
637
|
-
#include "
|
635
|
+
#if !defined(INTELLISENSE)
|
636
|
+
#include "../ServerConfig/AutoGeneratedManifestGeneration.cpp"
|
637
|
+
#include "../DirConfig/AutoGeneratedManifestGeneration.cpp"
|
638
|
+
#include "AutoGeneratedManifestDefaultsInitialization.cpp"
|
639
|
+
#endif
|
638
640
|
|
639
641
|
#endif /* _PASSENGER_APACHE2_MODULE_CONFIG_GENERAL_MANIFEST_GENERATION_H_ */
|
@@ -36,9 +36,10 @@ def main
|
|
36
36
|
|
37
37
|
#ifdef INTELLISENSE
|
38
38
|
// These includes do nothing, but keep IntelliSense happy.
|
39
|
+
#include <set>
|
39
40
|
#include <StaticString.h>
|
41
|
+
#include <Constants.h>
|
40
42
|
#include <ap_config.h>
|
41
|
-
#include "../ConfigGeneral/Common.h"
|
42
43
|
#endif
|
43
44
|
}
|
44
45
|
|