passenger 5.3.5 → 5.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -0
  3. data/README.md +2 -1
  4. data/Rakefile +0 -5
  5. data/build/agent.rb +2 -1
  6. data/build/cxx_tests.rb +18 -20
  7. data/build/integration_tests.rb +6 -2
  8. data/build/support/cxx_dependency_map.rb +2019 -1966
  9. data/dev/colorize-logs +272 -0
  10. data/src/agent/Core/AdminPanelConnector.h +3 -3
  11. data/src/agent/Core/ApiServer.h +4 -4
  12. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
  13. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +2 -2
  14. data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
  15. data/src/agent/Core/ApplicationPool/Pool.h +4 -4
  16. data/src/agent/Core/ApplicationPool/Process.h +10 -15
  17. data/src/agent/Core/ApplicationPool/Socket.h +2 -2
  18. data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
  19. data/src/agent/Core/Config.h +4 -2
  20. data/src/agent/Core/Controller.h +4 -4
  21. data/src/agent/Core/Controller/Config.h +1 -1
  22. data/src/agent/Core/Controller/SendRequest.cpp +2 -2
  23. data/src/agent/Core/Controller/TurboCaching.h +2 -2
  24. data/src/agent/Core/CoreMain.cpp +2 -2
  25. data/src/agent/Core/OptionParser.h +2 -2
  26. data/src/agent/Core/ResponseCache.h +3 -3
  27. data/src/agent/Core/SecurityUpdateChecker.h +2 -2
  28. data/src/agent/Core/SpawningKit/Config.h +2 -1
  29. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  30. data/src/agent/Core/SpawningKit/Context.h +1 -1
  31. data/src/agent/Core/SpawningKit/DirectSpawner.h +3 -3
  32. data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
  33. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  34. data/src/agent/Core/SpawningKit/Exceptions.h +2 -2
  35. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  36. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  37. data/src/agent/Core/SpawningKit/Handshake/Perform.h +13 -2
  38. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
  39. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  40. data/src/agent/Core/SpawningKit/Journey.h +4 -5
  41. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  42. data/src/agent/Core/SpawningKit/Result.h +20 -8
  43. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  44. data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -6
  45. data/src/agent/Core/SpawningKit/Spawner.h +2 -2
  46. data/src/agent/Core/TelemetryCollector.h +13 -7
  47. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  48. data/src/agent/README.md +1 -1
  49. data/src/agent/Shared/ApiAccountUtils.h +1 -1
  50. data/src/agent/Shared/ApiServerUtils.h +3 -3
  51. data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
  52. data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -4
  53. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  54. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
  55. data/src/agent/Watchdog/ApiServer.h +3 -3
  56. data/src/agent/Watchdog/Config.h +3 -2
  57. data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
  58. data/src/agent/Watchdog/WatchdogMain.cpp +93 -27
  59. data/src/apache2_module/Config.cpp +14 -14
  60. data/src/apache2_module/Config.h +8 -16
  61. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +505 -491
  62. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
  63. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +24 -1
  64. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
  65. data/src/{cxx_supportlib/Utils/MemoryBarrier.h → apache2_module/ConfigGeneral/Common.h} +17 -25
  66. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +12 -1
  67. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
  68. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
  69. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
  70. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +6 -1
  71. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
  72. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -1
  73. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
  74. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +23 -1
  75. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
  76. data/src/apache2_module/Hooks.cpp +3 -3
  77. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +24 -1
  78. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
  79. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
  80. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
  81. data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
  82. data/src/cxx_supportlib/ConfigKit/Schema.h +2 -2
  83. data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
  84. data/src/cxx_supportlib/Constants.h +1 -1
  85. data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
  86. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
  87. data/src/cxx_supportlib/DataStructures/LString.h +3 -3
  88. data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
  89. data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
  90. data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
  91. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  92. data/src/cxx_supportlib/Hooks.h +2 -2
  93. data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
  94. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +2 -2
  95. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
  96. data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
  97. data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
  98. data/src/cxx_supportlib/InstanceDirectory.h +4 -4
  99. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
  100. data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
  101. data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
  102. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
  103. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
  104. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +5 -5
  105. data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
  106. data/src/cxx_supportlib/RandomGenerator.h +2 -2
  107. data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
  108. data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
  109. data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
  110. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
  111. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  112. data/src/cxx_supportlib/ServerKit/Context.h +2 -2
  113. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
  114. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
  115. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  116. data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
  117. data/src/cxx_supportlib/ServerKit/Server.h +3 -3
  118. data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
  119. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
  120. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
  121. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +2 -2
  122. data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
  123. data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
  124. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +34 -0
  125. data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +6 -6
  126. data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
  127. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
  128. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
  129. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  130. data/src/cxx_supportlib/Utils.cpp +2 -2
  131. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
  132. data/src/cxx_supportlib/Utils/Curl.h +2 -2
  133. data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
  134. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  135. data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
  136. data/src/cxx_supportlib/Utils/Timer.h +2 -2
  137. data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
  138. data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
  139. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
  140. data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
  141. data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
  142. data/src/ruby_supportlib/phusion_passenger.rb +1 -1
  143. data/src/ruby_supportlib/phusion_passenger/common_library.rb +11 -11
  144. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
  145. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
  146. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
  147. data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
  148. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
  149. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
  150. data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
  151. metadata +28 -86
  152. data/.editorconfig +0 -134
  153. data/CODE_OF_CONDUCT.md +0 -52
  154. data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
  155. data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
  156. data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
  157. data/dev/ci/README.md +0 -134
  158. data/dev/ci/lib/functions.sh +0 -129
  159. data/dev/ci/lib/set-container-envvars.sh +0 -53
  160. data/dev/ci/lib/setup-container.sh +0 -46
  161. data/dev/ci/run-tests-natively +0 -24
  162. data/dev/ci/run-tests-with-docker +0 -42
  163. data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
  164. data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
  165. data/dev/ci/scripts/docker-entrypoint.sh +0 -17
  166. data/dev/ci/scripts/inituidgid +0 -17
  167. data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
  168. data/dev/ci/scripts/setup-host-natively.sh +0 -11
  169. data/dev/ci/setup-host +0 -56
  170. data/dev/ci/tests/apache2/run +0 -6
  171. data/dev/ci/tests/apache2/setup +0 -4
  172. data/dev/ci/tests/binaries/Jenkinsfile +0 -105
  173. data/dev/ci/tests/binaries/build-linux +0 -38
  174. data/dev/ci/tests/binaries/build-macos +0 -40
  175. data/dev/ci/tests/binaries/prepare-macos +0 -38
  176. data/dev/ci/tests/binaries/test-linux +0 -45
  177. data/dev/ci/tests/binaries/test-macos +0 -38
  178. data/dev/ci/tests/cxx/run +0 -9
  179. data/dev/ci/tests/cxx/setup +0 -4
  180. data/dev/ci/tests/debian/Jenkinsfile +0 -89
  181. data/dev/ci/tests/debian/run +0 -60
  182. data/dev/ci/tests/nginx-dynamic/run +0 -20
  183. data/dev/ci/tests/nginx-dynamic/setup +0 -4
  184. data/dev/ci/tests/nginx/run +0 -5
  185. data/dev/ci/tests/nginx/setup +0 -4
  186. data/dev/ci/tests/nodejs/run +0 -4
  187. data/dev/ci/tests/nodejs/setup +0 -4
  188. data/dev/ci/tests/rpm/Jenkinsfile +0 -68
  189. data/dev/ci/tests/rpm/run +0 -63
  190. data/dev/ci/tests/ruby/run +0 -4
  191. data/dev/ci/tests/ruby/setup +0 -4
  192. data/dev/ci/tests/source-packaging/run +0 -4
  193. data/dev/ci/tests/source-packaging/setup +0 -4
  194. data/dev/ci/tests/standalone/run +0 -4
  195. data/dev/ci/tests/standalone/setup +0 -4
  196. data/dev/configkit-schemas/index.json +0 -1850
  197. data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
  198. data/dev/rack.test/config.ru +0 -5
  199. data/dev/rack.test/public/asset.txt +0 -1
  200. data/dev/vagrant/apache_default_site.conf +0 -35
  201. data/dev/vagrant/apache_passenger.conf +0 -5
  202. data/dev/vagrant/apache_passenger.load +0 -1
  203. data/dev/vagrant/apache_ports.conf +0 -24
  204. data/dev/vagrant/apache_rack_test.conf +0 -9
  205. data/dev/vagrant/bashrc +0 -23
  206. data/dev/vagrant/nginx.conf +0 -39
  207. data/dev/vagrant/nginx_rakefile +0 -33
  208. data/dev/vagrant/nginx_start +0 -32
  209. data/dev/vagrant/provision.sh +0 -117
  210. data/dev/vagrant/sudoers.conf +0 -5
  211. data/resources/templates/error_renderer/.editorconfig +0 -19
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -37,7 +37,7 @@
37
37
  #include <LoggingKit/LoggingKit.h>
38
38
  #include <StaticString.h>
39
39
  #include <MemoryKit/palloc.h>
40
- #include <Utils/IOUtils.h>
40
+ #include <IOTools/IOUtils.h>
41
41
  #include <Core/ApplicationPool/Common.h>
42
42
 
43
43
  namespace Passenger {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2016-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2016-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -29,8 +29,8 @@
29
29
  #include <boost/thread.hpp>
30
30
  #include <string>
31
31
  #include <cassert>
32
- #include <Utils/IOUtils.h>
33
- #include <Utils/BufferedIO.h>
32
+ #include <IOTools/IOUtils.h>
33
+ #include <IOTools/BufferedIO.h>
34
34
  #include <Core/ApplicationPool/AbstractSession.h>
35
35
 
36
36
  namespace Passenger {
@@ -50,7 +50,7 @@
50
50
  #include <Shared/ApiAccountUtils.h>
51
51
  #include <Constants.h>
52
52
  #include <Utils.h>
53
- #include <Utils/IOUtils.h>
53
+ #include <IOTools/IOUtils.h>
54
54
 
55
55
  namespace Passenger {
56
56
  namespace Core {
@@ -145,6 +145,7 @@ using namespace std;
145
145
  * max_instances_per_app unsigned integer - read_only
146
146
  * max_pool_size unsigned integer - default(6)
147
147
  * multi_app boolean - default(false),read_only
148
+ * oom_score string - read_only
148
149
  * passenger_root string required read_only
149
150
  * pid_file string - read_only
150
151
  * pool_idle_time unsigned integer - default(300)
@@ -156,7 +157,7 @@ using namespace std;
156
157
  * security_update_checker_interval unsigned integer - default(86400)
157
158
  * security_update_checker_proxy_url string - -
158
159
  * security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
159
- * server_software string - default("Phusion_Passenger/5.3.5")
160
+ * server_software string - default("Phusion_Passenger/5.3.6")
160
161
  * show_version_in_header boolean - default(true)
161
162
  * single_app_mode_app_root string - default,read_only
162
163
  * single_app_mode_app_type string - read_only
@@ -470,6 +471,7 @@ public:
470
471
  add("config_manifest", OBJECT_TYPE, OPTIONAL | READ_ONLY);
471
472
  add("pid_file", STRING_TYPE, OPTIONAL | READ_ONLY);
472
473
  add("web_server_version", STRING_TYPE, OPTIONAL | READ_ONLY);
474
+ add("oom_score", STRING_TYPE, OPTIONAL | READ_ONLY);
473
475
  addWithDynamicDefault("controller_threads", UINT_TYPE, OPTIONAL | READ_ONLY, getDefaultThreads);
474
476
  add("max_pool_size", UINT_TYPE, OPTIONAL, DEFAULT_MAX_POOL_SIZE);
475
477
  add("pool_idle_time", UINT_TYPE, OPTIONAL, Json::UInt(DEFAULT_POOL_IDLE_TIME));
@@ -62,7 +62,7 @@
62
62
  #include <cctype>
63
63
 
64
64
  #include <LoggingKit/LoggingKit.h>
65
- #include <MessageReadersWriters.h>
65
+ #include <IOTools/MessageSerialization.h>
66
66
  #include <Constants.h>
67
67
  #include <ConfigKit/ConfigKit.h>
68
68
  #include <ServerKit/Errors.h>
@@ -74,9 +74,9 @@
74
74
  #include <WrapperRegistry/Registry.h>
75
75
  #include <StaticString.h>
76
76
  #include <Utils.h>
77
- #include <Utils/StrIntUtils.h>
78
- #include <Utils/IOUtils.h>
79
- #include <Utils/JsonUtils.h>
77
+ #include <StrIntTools/StrIntUtils.h>
78
+ #include <IOTools/IOUtils.h>
79
+ #include <JsonTools/JsonUtils.h>
80
80
  #include <Utils/HttpConstants.h>
81
81
  #include <Utils/Timer.h>
82
82
  #include <Core/Controller/Config.h>
@@ -113,7 +113,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
113
113
  * multi_app boolean - default(true),read_only
114
114
  * request_freelist_limit unsigned integer - default(1024)
115
115
  * response_buffer_high_watermark unsigned integer - default(134217728)
116
- * server_software string - default("Phusion_Passenger/5.3.5")
116
+ * server_software string - default("Phusion_Passenger/5.3.6")
117
117
  * show_version_in_header boolean - default(true)
118
118
  * start_reading_after_accept boolean - default(true)
119
119
  * stat_throttle_rate unsigned integer - default(10)
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -24,7 +24,7 @@
24
24
  * THE SOFTWARE.
25
25
  */
26
26
  #include <Core/Controller.h>
27
- #include <Utils/SystemTime.h>
27
+ #include <SystemTools/SystemTime.h>
28
28
 
29
29
  /*************************************************************************
30
30
  *
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2014-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -35,7 +35,7 @@
35
35
  #include <ServerKit/Context.h>
36
36
  #include <Constants.h>
37
37
  #include <LoggingKit/LoggingKit.h>
38
- #include <Utils/StrIntUtils.h>
38
+ #include <StrIntTools/StrIntUtils.h>
39
39
  #include <Core/ResponseCache.h>
40
40
 
41
41
  namespace Passenger {
@@ -82,7 +82,7 @@
82
82
  #include <ServerKit/Server.h>
83
83
  #include <ServerKit/AcceptLoadBalancer.h>
84
84
  #include <AppTypeDetector/Detector.h>
85
- #include <MessageReadersWriters.h>
85
+ #include <IOTools/MessageSerialization.h>
86
86
  #include <FileDescriptor.h>
87
87
  #include <ResourceLocator.h>
88
88
  #include <BackgroundEventLoop.cpp>
@@ -91,7 +91,7 @@
91
91
  #include <Exceptions.h>
92
92
  #include <Utils.h>
93
93
  #include <Utils/Timer.h>
94
- #include <Utils/MessageIO.h>
94
+ #include <IOTools/MessageIO.h>
95
95
  #include <Core/OptionParser.h>
96
96
  #include <Core/Controller.h>
97
97
  #include <Core/ApiServer.h>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -34,7 +34,7 @@
34
34
  #include <JsonTools/Autocast.h>
35
35
  #include <Utils.h>
36
36
  #include <Utils/OptionParsing.h>
37
- #include <Utils/StrIntUtils.h>
37
+ #include <StrIntTools/StrIntUtils.h>
38
38
 
39
39
  #include <jsoncpp/json.h>
40
40
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2014-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -34,8 +34,8 @@
34
34
  #include <ServerKit/http_parser.h>
35
35
  #include <ServerKit/CookieUtils.h>
36
36
  #include <StaticString.h>
37
- #include <Utils/DateParsing.h>
38
- #include <Utils/StrIntUtils.h>
37
+ #include <StrIntTools/DateParsing.h>
38
+ #include <StrIntTools/StrIntUtils.h>
39
39
 
40
40
  namespace Passenger {
41
41
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2017 Phusion Holding B.V.
3
+ * Copyright (c) 2017-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -33,7 +33,7 @@
33
33
  #include <oxt/thread.hpp>
34
34
  #include <oxt/backtrace.hpp>
35
35
 
36
- #include <Crypto.h>
36
+ #include <SecurityKit/Crypto.h>
37
37
  #include <ResourceLocator.h>
38
38
  #include <Exceptions.h>
39
39
  #include <StaticString.h>
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -299,6 +299,7 @@ public:
299
299
  * to the given log file.
300
300
  *
301
301
  * @hinted_parseable
302
+ * @non_confidential
302
303
  * @pass_during_handshake
303
304
  */
304
305
  StaticString logFile;
@@ -344,7 +344,7 @@ Passenger::SpawningKit::Config::getNonConfidentialFieldsToPassToApp() const {
344
344
  doc["user"] = user.toString();
345
345
  doc["group"] = group.toString();
346
346
  doc["environment_variables"] = "<SECRET>";
347
- doc["log_file"] = "<SECRET>";
347
+ doc["log_file"] = logFile.toString();
348
348
  if (!config.apiKey.empty()) {
349
349
  doc["api_key"] = "<SECRET>";
350
350
  }
@@ -37,7 +37,7 @@
37
37
  #include <RandomGenerator.h>
38
38
  #include <Exceptions.h>
39
39
  #include <WrapperRegistry/Registry.h>
40
- #include <Utils/JsonUtils.h>
40
+ #include <JsonTools/JsonUtils.h>
41
41
  #include <ConfigKit/Store.h>
42
42
 
43
43
  namespace Passenger {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -36,7 +36,7 @@
36
36
  #include <Constants.h>
37
37
  #include <LoggingKit/LoggingKit.h>
38
38
  #include <LveLoggingDecorator.h>
39
- #include <Utils/IOUtils.h>
39
+ #include <IOTools/IOUtils.h>
40
40
  #include <Utils/AsyncSignalSafeUtils.h>
41
41
 
42
42
  #include <limits.h> // for PTHREAD_STACK_MIN
@@ -164,7 +164,7 @@ private:
164
164
  dup2(stdinCopy, 0);
165
165
  dup2(stdoutAndErrCopy, 1);
166
166
  dup2(stdoutAndErrCopy, 2);
167
- closeAllFileDescriptors(2, true);
167
+ closeAllFileDescriptors(2);
168
168
 
169
169
  execlp(agentFilename.c_str(),
170
170
  agentFilename.c_str(),
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -31,7 +31,7 @@
31
31
  #include <vector>
32
32
 
33
33
  #include <StaticString.h>
34
- #include <Utils/StrIntUtils.h>
34
+ #include <StrIntTools/StrIntUtils.h>
35
35
  #include <Core/SpawningKit/Spawner.h>
36
36
  #include <Core/SpawningKit/Exceptions.h>
37
37
 
@@ -89,7 +89,7 @@ public:
89
89
 
90
90
  result.initialize(*context, &config);
91
91
  result.pid = number;
92
- result.dummy = true;
92
+ result.type = Result::DUMMY;
93
93
  result.gupid = "gupid-" + toString(number);
94
94
  result.spawnEndTime = result.spawnStartTime;
95
95
  result.spawnEndTimeMonotonic = result.spawnStartTimeMonotonic;
@@ -35,7 +35,7 @@
35
35
  #include <Constants.h>
36
36
  #include <StaticString.h>
37
37
  #include <FileTools/FileManip.h>
38
- #include <Utils/Template.h>
38
+ #include <StrIntTools/Template.h>
39
39
  #include <Core/SpawningKit/Context.h>
40
40
  #include <Core/SpawningKit/Exceptions.h>
41
41
 
@@ -36,8 +36,8 @@
36
36
  #include <LoggingKit/LoggingKit.h>
37
37
  #include <DataStructures/StringKeyTable.h>
38
38
  #include <ProcessManagement/Spawn.h>
39
- #include <Utils/StrIntUtils.h>
40
- #include <Utils/SystemMetricsCollector.h>
39
+ #include <SystemTools/SystemMetricsCollector.h>
40
+ #include <StrIntTools/StrIntUtils.h>
41
41
  #include <Core/SpawningKit/Config.h>
42
42
  #include <Core/SpawningKit/Journey.h>
43
43
 
@@ -48,7 +48,7 @@ private:
48
48
  SpawnerPtr tryCreateSmartSpawner(const AppPoolOptions &options) {
49
49
  string dir = context->resourceLocator->getHelperScriptsDir();
50
50
  vector<string> preloaderCommand;
51
- if (options.appType == "rack") {
51
+ if (options.appType == "ruby" || options.appType == "rack") {
52
52
  preloaderCommand.push_back(options.ruby);
53
53
  preloaderCommand.push_back(dir + "/rack-preloader.rb");
54
54
  } else {
@@ -42,7 +42,7 @@
42
42
  #include <FileDescriptor.h>
43
43
  #include <StaticString.h>
44
44
  #include <Utils.h>
45
- #include <Utils/StrIntUtils.h>
45
+ #include <StrIntTools/StrIntUtils.h>
46
46
 
47
47
  namespace Passenger {
48
48
  namespace SpawningKit {
@@ -52,8 +52,8 @@
52
52
  #include <FileTools/PathManip.h>
53
53
  #include <Utils.h>
54
54
  #include <Utils/ScopeGuard.h>
55
- #include <Utils/SystemTime.h>
56
- #include <Utils/StrIntUtils.h>
55
+ #include <SystemTools/SystemTime.h>
56
+ #include <StrIntTools/StrIntUtils.h>
57
57
  #include <Core/SpawningKit/Config.h>
58
58
  #include <Core/SpawningKit/Exceptions.h>
59
59
  #include <Core/SpawningKit/Handshake/BackgroundIOCapturer.h>
@@ -297,6 +297,7 @@ private:
297
297
  result.stdoutAndErrFd = stdoutAndErrFd;
298
298
  result.spawnEndTime = SystemTime::getUsec();
299
299
  result.spawnEndTimeMonotonic = SystemTime::getMonotonicUsec();
300
+ setResultType(result);
300
301
 
301
302
  if (socketIsNowPingable) {
302
303
  assert(config->genericApp || config->findFreePort);
@@ -1674,6 +1675,16 @@ private:
1674
1675
  return result;
1675
1676
  }
1676
1677
 
1678
+ void setResultType(Result &result) const {
1679
+ if (config->genericApp) {
1680
+ result.type = Result::GENERIC;
1681
+ } else if (config->startsUsingWrapper) {
1682
+ result.type = Result::AUTO_SUPPORTED;
1683
+ } else {
1684
+ result.type = Result::KURIA;
1685
+ }
1686
+ }
1687
+
1677
1688
  public:
1678
1689
  struct DebugSupport {
1679
1690
  virtual ~DebugSupport() { }
@@ -56,10 +56,10 @@
56
56
  #include <FileTools/FileManip.h>
57
57
  #include <FileTools/PathManip.h>
58
58
  #include <SystemTools/UserDatabase.h>
59
- #include <Utils/SystemTime.h>
59
+ #include <SystemTools/SystemTime.h>
60
60
  #include <Utils/Timer.h>
61
- #include <Utils/IOUtils.h>
62
- #include <Utils/StrIntUtils.h>
61
+ #include <IOTools/IOUtils.h>
62
+ #include <StrIntTools/StrIntUtils.h>
63
63
  #include <Core/SpawningKit/Context.h>
64
64
  #include <Core/SpawningKit/Config.h>
65
65
  #include <Core/SpawningKit/Journey.h>
@@ -36,7 +36,7 @@
36
36
 
37
37
  #include <Exceptions.h>
38
38
  #include <Utils.h>
39
- #include <Utils/StrIntUtils.h>
39
+ #include <StrIntTools/StrIntUtils.h>
40
40
 
41
41
  namespace Passenger {
42
42
  namespace SpawningKit {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2017 Phusion Holding B.V.
3
+ * Copyright (c) 2017-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -36,10 +36,9 @@
36
36
 
37
37
  #include <LoggingKit/LoggingKit.h>
38
38
  #include <StaticString.h>
39
- #include <Utils/SystemTime.h>
40
- #include <Utils/JsonUtils.h>
41
- #include <Utils/StrIntUtils.h>
42
- #include <Utils/SystemTime.h>
39
+ #include <SystemTools/SystemTime.h>
40
+ #include <JsonTools/JsonUtils.h>
41
+ #include <StrIntTools/StrIntUtils.h>
43
42
 
44
43
  namespace Passenger {
45
44
  namespace SpawningKit {
@@ -43,7 +43,7 @@
43
43
  #include <Constants.h>
44
44
  #include <LoggingKit/LoggingKit.h>
45
45
  #include <Utils.h>
46
- #include <Utils/StrIntUtils.h>
46
+ #include <StrIntTools/StrIntUtils.h>
47
47
 
48
48
  namespace Passenger {
49
49
  namespace SpawningKit {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2014-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -33,7 +33,7 @@
33
33
 
34
34
  #include <FileDescriptor.h>
35
35
  #include <Exceptions.h>
36
- #include <Utils/SystemTime.h>
36
+ #include <SystemTools/SystemTime.h>
37
37
  #include <ConfigKit/ConfigKit.h>
38
38
  #include <Core/SpawningKit/Context.h>
39
39
  #include <Core/SpawningKit/Config.h>
@@ -113,6 +113,19 @@ public:
113
113
  }
114
114
  };
115
115
 
116
+ enum Type {
117
+ UNKNOWN,
118
+ GENERIC,
119
+ KURIA,
120
+ AUTO_SUPPORTED,
121
+ /**
122
+ * Indicates that this Process does not refer to a real OS
123
+ * process. The sockets in the socket list are fake and need not be deleted.
124
+ * Set to true by DummySpawner, used during unit tests.
125
+ */
126
+ DUMMY
127
+ };
128
+
116
129
  private:
117
130
  void validate_autoGeneratedCode(vector<StaticString> &internalFieldErrors,
118
131
  vector<StaticString> &appSuppliedFieldErrors) const;
@@ -127,13 +140,9 @@ public:
127
140
  pid_t pid;
128
141
 
129
142
  /**
130
- * If true, then indicates that this Process does not refer to a real OS
131
- * process. The sockets in the socket list are fake and need not be deleted.
132
- * Set to true by DummySpawner, used during unit tests.
133
- *
134
143
  * @hinted_parseable
135
144
  */
136
- bool dummy;
145
+ Type type;
137
146
 
138
147
  /**
139
148
  * @hinted_parseable
@@ -188,7 +197,7 @@ public:
188
197
 
189
198
  Result()
190
199
  : pid(-1),
191
- dummy(false),
200
+ type(UNKNOWN),
192
201
  spawnStartTime(0),
193
202
  spawnEndTime(0),
194
203
  spawnStartTimeMonotonic(0),
@@ -207,6 +216,9 @@ public:
207
216
  {
208
217
  validate_autoGeneratedCode(internalFieldErrors, appSuppliedFieldErrors);
209
218
 
219
+ if (type == UNKNOWN) {
220
+ internalFieldErrors.push_back(P_STATIC_STRING("type may not be unknown"));
221
+ }
210
222
  if (sockets.empty()) {
211
223
  appSuppliedFieldErrors.push_back(P_STATIC_STRING("sockets are not supplied"));
212
224
  }