passenger 5.0.9 → 5.0.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (106) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/CHANGELOG +15 -0
  5. data/CONTRIBUTORS +6 -0
  6. data/README.md +1 -1
  7. data/bin/passenger-install-apache2-module +24 -11
  8. data/bin/passenger-status +29 -14
  9. data/build/agents.rb +12 -10
  10. data/build/cxx_tests.rb +30 -30
  11. data/doc/Design and Architecture.html +1 -10
  12. data/doc/Design and Architecture.txt +1 -6
  13. data/doc/Users guide Apache.html +1 -19
  14. data/doc/Users guide Apache.txt +1 -1
  15. data/doc/Users guide Nginx.html +2 -20
  16. data/doc/Users guide Nginx.txt +2 -2
  17. data/doc/users_guide_snippets/tips.txt +0 -9
  18. data/ext/common/ApplicationPool2/ApiKey.h +158 -0
  19. data/ext/common/ApplicationPool2/BasicGroupInfo.h +81 -0
  20. data/ext/common/ApplicationPool2/BasicProcessInfo.h +106 -0
  21. data/ext/common/ApplicationPool2/Common.h +5 -44
  22. data/ext/common/ApplicationPool2/Context.h +94 -0
  23. data/ext/common/ApplicationPool2/Group.h +130 -1205
  24. data/ext/common/ApplicationPool2/Group/InitializationAndShutdown.cpp +190 -0
  25. data/ext/common/ApplicationPool2/Group/InternalUtils.cpp +329 -0
  26. data/ext/common/ApplicationPool2/Group/LifetimeAndBasics.cpp +103 -0
  27. data/ext/common/ApplicationPool2/{Pool/Debug.h → Group/Miscellaneous.cpp} +40 -38
  28. data/ext/common/ApplicationPool2/Group/OutOfBandWork.cpp +323 -0
  29. data/ext/common/ApplicationPool2/Group/ProcessListManagement.cpp +606 -0
  30. data/ext/common/ApplicationPool2/Group/SessionManagement.cpp +337 -0
  31. data/ext/common/ApplicationPool2/Group/SpawningAndRestarting.cpp +478 -0
  32. data/ext/common/ApplicationPool2/Group/StateInspection.cpp +197 -0
  33. data/ext/common/ApplicationPool2/Group/Verification.cpp +159 -0
  34. data/ext/common/ApplicationPool2/Implementation.cpp +19 -1401
  35. data/ext/common/ApplicationPool2/Options.h +5 -5
  36. data/ext/common/ApplicationPool2/Pool.h +260 -815
  37. data/ext/common/ApplicationPool2/Pool/{AnalyticsCollection.h → AnalyticsCollection.cpp} +55 -56
  38. data/ext/common/ApplicationPool2/Pool/{GarbageCollection.h → GarbageCollection.cpp} +49 -49
  39. data/ext/common/ApplicationPool2/Pool/GeneralUtils.cpp +241 -0
  40. data/ext/common/ApplicationPool2/Pool/GroupUtils.cpp +276 -0
  41. data/ext/common/ApplicationPool2/Pool/InitializationAndShutdown.cpp +145 -0
  42. data/ext/common/ApplicationPool2/Pool/Miscellaneous.cpp +244 -0
  43. data/ext/common/ApplicationPool2/Pool/ProcessUtils.cpp +330 -0
  44. data/ext/common/ApplicationPool2/Pool/StateInspection.cpp +299 -0
  45. data/ext/common/ApplicationPool2/Process.h +399 -205
  46. data/ext/common/ApplicationPool2/Session.h +70 -28
  47. data/ext/common/ApplicationPool2/Socket.h +1 -0
  48. data/ext/common/Constants.h +11 -3
  49. data/ext/common/Exceptions.h +1 -1
  50. data/ext/common/Logging.cpp +9 -4
  51. data/ext/common/Logging.h +6 -0
  52. data/ext/common/ServerKit/HttpServer.h +225 -215
  53. data/ext/common/ServerKit/Server.h +57 -57
  54. data/ext/common/SpawningKit/BackgroundIOCapturer.h +160 -0
  55. data/ext/common/SpawningKit/Config.h +107 -0
  56. data/ext/common/{ApplicationPool2 → SpawningKit}/DirectSpawner.h +17 -16
  57. data/ext/common/{ApplicationPool2 → SpawningKit}/DummySpawner.h +33 -33
  58. data/ext/common/{ApplicationPool2/SpawnerFactory.h → SpawningKit/Factory.h} +17 -17
  59. data/ext/common/{ApplicationPool2/ComponentInfo.h → SpawningKit/Options.h} +8 -21
  60. data/ext/common/SpawningKit/PipeWatcher.h +148 -0
  61. data/ext/common/{ApplicationPool2/PipeWatcher.h → SpawningKit/Result.h} +15 -33
  62. data/ext/common/{ApplicationPool2 → SpawningKit}/SmartSpawner.h +52 -57
  63. data/ext/common/{ApplicationPool2 → SpawningKit}/Spawner.h +83 -371
  64. data/ext/common/SpawningKit/UserSwitchingRules.h +265 -0
  65. data/ext/common/Utils/BufferedIO.h +24 -0
  66. data/ext/common/{ApplicationPool2/SpawnObject.h → Utils/ClassUtils.h} +24 -51
  67. data/ext/common/Utils/IOUtils.cpp +70 -0
  68. data/ext/common/Utils/IOUtils.h +19 -0
  69. data/ext/common/Utils/JsonUtils.h +113 -0
  70. data/ext/common/Utils/StrIntUtils.h +29 -0
  71. data/ext/common/Utils/json.h +1 -1
  72. data/ext/common/agents/ApiServerUtils.h +941 -0
  73. data/ext/common/agents/HelperAgent/{AdminServer.h → ApiServer.h} +163 -365
  74. data/ext/common/agents/HelperAgent/Main.cpp +86 -88
  75. data/ext/common/agents/HelperAgent/OptionParser.h +9 -10
  76. data/ext/common/agents/HelperAgent/RequestHandler/BufferBody.cpp +3 -0
  77. data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +2 -0
  78. data/ext/common/agents/HelperAgent/RequestHandler/Hooks.cpp +1 -1
  79. data/ext/common/agents/HelperAgent/RequestHandler/SendRequest.cpp +2 -2
  80. data/ext/common/agents/LoggingAgent/ApiServer.h +279 -0
  81. data/ext/common/agents/LoggingAgent/Main.cpp +41 -51
  82. data/ext/common/agents/LoggingAgent/OptionParser.h +11 -11
  83. data/ext/common/agents/Watchdog/ApiServer.h +311 -0
  84. data/ext/common/agents/Watchdog/Main.cpp +91 -65
  85. data/helper-scripts/prespawn +2 -0
  86. data/lib/phusion_passenger.rb +1 -1
  87. data/lib/phusion_passenger/admin_tools/instance.rb +1 -1
  88. data/lib/phusion_passenger/common_library.rb +27 -14
  89. data/lib/phusion_passenger/config/{admin_command_command.rb → api_call_command.rb} +19 -16
  90. data/lib/phusion_passenger/config/detach_process_command.rb +6 -3
  91. data/lib/phusion_passenger/config/main.rb +3 -5
  92. data/lib/phusion_passenger/config/reopen_logs_command.rb +29 -7
  93. data/lib/phusion_passenger/config/restart_app_command.rb +13 -4
  94. data/lib/phusion_passenger/config/utils.rb +15 -8
  95. data/lib/phusion_passenger/constants.rb +6 -2
  96. data/lib/phusion_passenger/platform_info/apache.rb +4 -0
  97. data/lib/phusion_passenger/platform_info/apache_detector.rb +18 -3
  98. data/resources/templates/apache2/mpm_unknown.txt.erb +20 -0
  99. metadata +42 -21
  100. metadata.gz.asc +7 -7
  101. data/ext/common/ApplicationPool2/Pool/GeneralUtils.h +0 -127
  102. data/ext/common/ApplicationPool2/Pool/Inspection.h +0 -219
  103. data/ext/common/ApplicationPool2/Pool/ProcessUtils.h +0 -85
  104. data/ext/common/ApplicationPool2/SuperGroup.h +0 -706
  105. data/ext/common/agents/LoggingAgent/AdminServer.h +0 -435
  106. data/ext/common/agents/Watchdog/AdminServer.h +0 -432
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTFhY2FmOWRiZWQ2ZjZkZmZjMTMzMjY1YTdmMjIyMTdjMjY5Njg5MA==
4
+ NTE3MDk3NTZhM2E0YmZjYjRlMGQ1MTU2NDZmNzBmZTlhNmE4NWI0OQ==
5
5
  data.tar.gz: !binary |-
6
- NTU2MGZmMWFhZmE1ZWI1MDQ3MWU5NjBjMmE1MGEyNjNkMTBjYzllYQ==
6
+ ZmU4MjYyZGJjOWI5ZTJjODUwYzM3MTc3YWVlNDA5MWY0MDllOTQyZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Mjg3NTEyMzgzYTU4Yjk3OGExMGYxZDkwZjlhODc0OGIyMjUxNDI1N2JiY2I5
10
- MWE2ODM1OTRiMGQwZWU2MGE2MDg1MzVkM2RmOTUwNjUwOGNmYTAxNTZiODI0
11
- M2FiM2RkNWUyYjRiZmU3MGYwODE1YjllNzlmOGU1YWNhNDFkODM=
9
+ NzdjNDJlMjQ3ZDJkZTg1N2YwMmExYTYxNDM3OWM1YTI0ZGE5MWRhZTBjYjM4
10
+ YTk4ZGE1OGUyZTVhYWMxZDVhN2YyMjBiZWI0ZDNkNDFiN2Y5M2Y0OTY1Njgx
11
+ ODNlZmQ4NzQwMzI2OTYwN2ZmYzAxMWJkZGQwN2Q1NjI5MDc5NDI=
12
12
  data.tar.gz: !binary |-
13
- YWFmZjI1MzI3ZmRiZjgxMTZjYjFkZGE3NGUyYWZkYThiNmI4YjYyNTY5NWJl
14
- NDYxMDRlNzU1NGQyNWZkN2JmNjVmNTc3ODBkNWMxOTE3YmJiYjNlNjA4ZTE1
15
- Yzc0ZGJiOTQ0MzQ4ZTZiZTY4Yjg4YmU5MzYwYjIwOTQ3YTIwOWQ=
13
+ MmFkMmMxMzNmYzQ2YWQ5MDc5ZjE1ODU0YzVlMzRiNGEyOWE4ZWRmNTE5NTI4
14
+ YWQxYTgxMWIyNTJmZWJjM2FjYzA3ODY5Yzc0OTI2NTU0OGZiZjJkNjlmYjY2
15
+ NTI0ODU4MWQ5NDc1MDI3YWMzYTZkZjlhZDIyZDk4OTg2NTZlOGU=
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJVb0YJAAoJECrHRaUKISqMfcIIAIii/TpyNGySvg08YS36RVU5
6
- wJi6g3Y8UZ04Kjd9Ccdn8c1JXJbOR3JYY1Dl+8MP8ZIqBuIx0MnVXcj4Vn1RxFjj
7
- GSIBKpRtpiIpajeqsULfsHOOyc0sZqZJzISh6WFgYhAZC0x7gEJoB217PJd2YK2h
8
- PxegmOj2+2EGB86T9LhG9u8QIdoQgvydnnE4mNfnNBAKDMFrG9f86HqetlBy2PK5
9
- EqmV1nysqM4w8F/tLhiwB34/t4zUFVLsGfw1Ek+hHCyKmAMJRsBchrWF40ZJdlB0
10
- O7Tv52czrajhazEYsNajvj9HmN2eQL1Wv3H7Tm0pChB/TRweahmVAXYG40PBsR4=
11
- =QFWp
5
+ iQEcBAABAgAGBQJVeH8AAAoJECrHRaUKISqMiO4IAKoKQUyUaazkuMdhIcm92NQB
6
+ NXuz0Cv+ckyoJIc6IRBNiXXaV+uys67pAYhQQVLcuVaTQ3BN5M4JylZQbad8soSY
7
+ A70O2pL6vdIovVfiGFacesLphy6cSjAJ75EG5Vh2D/RcSRwVQvoeFvRjyU72pAsY
8
+ ixXiM8DT+jw09FHphD4dFozh8adD3yuqKIUWCPE7qkPKD9G5Inu2QzIUpUJQQ7bh
9
+ 6G58J0ohn2AL18qRIVIFrrGjxc1M4fPgwQFDK+a/+NhEDeAQH5KgfQ6wqSS1Lz0i
10
+ dG1+jqntPM8Be6FzzWYTB1L+uVd8IfE9UM1+REgvGJG8roGISWlC+3tWl5Mp14E=
11
+ =68/m
12
12
  -----END PGP SIGNATURE-----
data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJVb0YJAAoJECrHRaUKISqMPRsIAIdmYwKUqKv0J9nS3gFUBBGa
6
- BPOS+uxmWtItdk3QfbxSlIZlCKehSB/tnn/L64fspxIx+cPUDh+h4A2/dKlSRl8z
7
- fhn1gOOBdaidK+pvMiqjHja3ssXwfD2S2zANWrBFU8zJgjx0/DvE/lqsb1JkOQRT
8
- Tukdj/vitrhySTaKvbOjE0lXljuAD+AFMI92yypBsiTXdb3Dg2VKd0NhcedI0+2m
9
- LSvCXKgP+/X6iqSRuIoLfWKzSdnoGeZqNDYwc8nm9TxbWAlpQ1DVS6vQgCsAztA2
10
- dDeJxWdS8V4pirjoddT/TpvEqrPRSjiS3uPRXwH4u2i/6uCl98xZ5t2v9q7+svQ=
11
- =1sKu
5
+ iQEcBAABAgAGBQJVeH7/AAoJECrHRaUKISqMQZ8H/RnWcjNuNcpgRko+KV6nLxof
6
+ /meZflUvmMn6QvR2kE4f4zEsGrhwoP5w17f4+gvg19b8IfSOrqHOFrET8rc4UEUu
7
+ TOytgbpyPD4BGSjjy4LCn5Ldv+AA/VE3817IZuozo+j6NuQ6qcKReeNt8K4DXDZ6
8
+ aPSRwuY5zqWpK/g69e1byqxn5LrotoyLSmmbpCDObQxAXDHelnluRw1JiEFzojAj
9
+ 6ObZj/i7XbHnGKIa3QsvdEh1y63Lnc8T+7N1seukqceLmbQ+D85cWuE7BEbTJhBA
10
+ /8+RF4t1v5tuRaXOPaQKDT/SD+Re3KO5kuuNc8a6q4TiLVGyJ3eApkilqFzCEsA=
11
+ =LCRZ
12
12
  -----END PGP SIGNATURE-----
data/CHANGELOG CHANGED
@@ -1,3 +1,17 @@
1
+ Release 5.0.10
2
+ --------------
3
+
4
+ * It is now possible to run `passenger-status`, `passenger-config restart-app` and other admin commands without using sudo. When run without sudo, these admin commands will allow you to operate on apps and processes that are owned by the user that invoked the admin command. Closes GH-1392.
5
+ * Fixes a crash introduces in 5.0.9 due to not properly initializing a variable. Closes GH-1530.
6
+ * The `passenger-config reopen-logs` command now works by instructing the Watchdog process to reopen the log file, while instructing the other Passenger processes to re-inerhit the log file from the Watchdog instead of trying to reopen the log file on their own. This makes log file reopening more robust. Closes GH-1452.
7
+ * `passenger-config restart-app` no longer leaves the terminal in a state with black background. Closes GH-1526.
8
+ * `passenger-config admin-command` has been renamed to `passenger-config api-call` in order to avoid confusion with any potential admin interfaces that we will introduce in the future.
9
+ * If Union Station support is enabled, process and system metrics weren't being sent correctly to Union Station. This has been fixed.
10
+ * [Enterprise] Fixes the fact that the Passenger Enterprise RPM didn't correctly set SELinux permissions on its own files.
11
+ * [Apache] passenger-install-apache2-module no longer aborts with an error if the Apache configuration file contains errors. Closes GH-1525.
12
+ * [Apache] Fixes a typo that would cause passenger-install-apache2-module to crash on Red Hat and CentOS systems on which the SELinux command line tools are not installed. Closes GH-1527.
13
+
14
+
1
15
  Release 5.0.9
2
16
  -------------
3
17
 
@@ -163,6 +177,7 @@ Release 5.0.0 release candidate 1
163
177
  * [Nginx] It is no longer necessary to re-specify `passenger_enabled` in `location` contexts. Closes GH-1338.
164
178
  * [Enterprise] Fixed a bug in mass deployment reloading.
165
179
  * [Enterprise] Fixed a bug in mass deployment daemonization.
180
+ * [Enterprise] Fixed passenger-irb. Closes GH-1350.
166
181
  * [Enterprise] The mass deployment mode now supports the `app_type` and `startup_file` configuration options in Passengerfile.json/passenger-standalone.json. Closes GH-1366.
167
182
 
168
183
 
@@ -13,6 +13,7 @@ Chad Fowler
13
13
  Chris Walquist
14
14
  Christoffer Sawicki
15
15
  Clemens Gruber
16
+ Cody Russell
16
17
  Damien Le Berrigaud
17
18
  Dan Peterson
18
19
  Danial Pearce
@@ -25,6 +26,7 @@ Dmitry Galinsky
25
26
  Dylan Vaughn
26
27
  Erik Ogan
27
28
  Evan Phoenix
29
+ Fedor Sumkin
28
30
  flygoast
29
31
  Gaspard Bucher
30
32
  Goffert van Gool (Phusion)
@@ -44,6 +46,7 @@ Jan Berkel
44
46
  Jason Cannon
45
47
  jastix
46
48
  Jay Freeman (saurik)
49
+ jbergler
47
50
  John Dewey
48
51
  John Leach
49
52
  Joshua Lund
@@ -66,8 +69,10 @@ Paul Kmiec
66
69
  Pepijn Looije
67
70
  Perry Smith
68
71
  Philip M. Gollucci
72
+ Radagaisus
69
73
  Redmar Kerkhoff
70
74
  remi
75
+ Richard Michael
71
76
  Rob Paisley
72
77
  Robin Bowes
73
78
  Ryan Schwartz
@@ -77,6 +82,7 @@ Sam Pohlenz
77
82
  Sean Wilkinson
78
83
  Sebastian Delmont
79
84
  Slippy Douglas
85
+ Stephen Bannasch
80
86
  Tim Bishop
81
87
  Tim Carey-Smith
82
88
  Tinco Andringa (Phusion)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  What makes it so fast and reliable is its **C++** core, its **zero-copy** architecture, its **watchdog** system and its **hybrid** evented, multi-threaded and multi-process design.
6
6
 
7
- <a href="http://vimeo.com/phusionnl/review/80475623/c16e940d1f"><img src="http://blog.phusion.nl/wp-content/uploads/2014/01/gameofthrones.jpg" height="300"></a><br><em>Phusion Passenger used in Game of Thrones Ascention</em>
7
+ <a href="http://vimeo.com/phusionnl/review/80475623/c16e940d1f"><img src="http://blog.phusion.nl/wp-content/uploads/2014/01/gameofthrones.jpg" height="300"></a><br><em>Phusion Passenger used in Game of Thrones Ascent</em>
8
8
 
9
9
  **Learn more:** [Website](https://www.phusionpassenger.com/) | [Documentation](https://www.phusionpassenger.com/documentation_and_support) | [Support resources](https://www.phusionpassenger.com/documentation_and_support) | [Github](https://github.com/phusion/passenger) | [Twitter](https://twitter.com/phusion_nl) | [Blog](http://blog.phusion.nl/)
10
10
 
@@ -162,7 +162,7 @@ private
162
162
  begin
163
163
  sestatus = `sestatus`
164
164
  getenforce = `getenforce`
165
- rescue Errno::ENOTENT
165
+ rescue Errno::ENOENT
166
166
  return
167
167
  end
168
168
 
@@ -281,21 +281,34 @@ private
281
281
  # Server compiled with....
282
282
  # -D APACHE_MPM_DIR="server/mpm/prefork"
283
283
  output = PlatformInfo.apache2ctl_V
284
- output =~ /^Server MPM: +(.*)$/
285
- if $1
286
- mpm = $1.downcase
287
- else
288
- output =~ /APACHE_MPM_DIR="server\/mpm\/(.*)"/
284
+
285
+ if output
286
+ output =~ /^Server MPM: +(.*)$/
289
287
  if $1
290
288
  mpm = $1.downcase
291
289
  else
292
- mpm = nil
290
+ output =~ /APACHE_MPM_DIR="server\/mpm\/(.*)"/
291
+ if $1
292
+ mpm = $1.downcase
293
+ else
294
+ mpm = nil
295
+ end
293
296
  end
294
- end
295
- if mpm != "prefork" && mpm != "worker" && mpm != "event"
297
+ if mpm != "prefork" && mpm != "worker" && mpm != "event"
298
+ new_screen
299
+ render_template 'apache2/apache_must_be_compiled_with_compatible_mpm',
300
+ :current_mpm => mpm
301
+ wait
302
+ end
303
+ elsif !@apache2.config_file_broken?
304
+ # 'output' may be nil because the config file is broken (see
305
+ # PlatformInfo.apache2ctl_V for more information), but we already
306
+ # warn the user about in #validate_install.
307
+ # So here we only warn about not being able to detect an MPM type
308
+ # if 'output' is nil but not as a result of the config file being broken.
296
309
  new_screen
297
- render_template 'apache2/apache_must_be_compiled_with_compatible_mpm',
298
- :current_mpm => mpm
310
+ render_template 'apache2/mpm_unknown',
311
+ :control_command => @apache2.ctl
299
312
  wait
300
313
  end
301
314
  end
@@ -106,17 +106,20 @@ end
106
106
 
107
107
  def show_status(instance, options)
108
108
  # if the noshow override is not specified, the default is to show the header, unless show=xml
109
- if options[:noheader] != true && options[:show] != 'xml'
109
+ if options[:noheader] != true && options[:show] != 'xml'
110
110
  print_header(STDOUT, instance)
111
111
  end
112
112
 
113
113
  case options[:show]
114
114
  when 'pool'
115
115
  request = Net::HTTP::Get.new("/pool.txt?colorize=#{options[:color]}&verbose=#{options[:verbose]}")
116
- request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
117
- response = instance.http_request("agents.s/server_admin", request)
116
+ try_performing_ro_admin_basic_auth(request, instance)
117
+ response = instance.http_request("agents.s/server_api", request)
118
118
  if response.code.to_i / 100 == 2
119
119
  puts response.body
120
+ elsif response.code.to_i == 401
121
+ print_permission_error_message
122
+ exit 2
120
123
  else
121
124
  STDERR.puts "*** An error occured."
122
125
  STDERR.puts "#{response.code}: #{response.body}"
@@ -125,10 +128,13 @@ def show_status(instance, options)
125
128
 
126
129
  when 'requests', 'server'
127
130
  request = Net::HTTP::Get.new("/server.json")
128
- request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
129
- response = instance.http_request("agents.s/server_admin", request)
131
+ try_performing_ro_admin_basic_auth(request, instance)
132
+ response = instance.http_request("agents.s/server_api", request)
130
133
  if response.code.to_i / 100 == 2
131
134
  puts response.body
135
+ elsif response.code.to_i == 401
136
+ print_permission_error_message
137
+ exit 2
132
138
  else
133
139
  STDERR.puts "*** An error occured."
134
140
  STDERR.puts "#{response.code}: #{response.body}"
@@ -137,8 +143,8 @@ def show_status(instance, options)
137
143
 
138
144
  when 'backtraces'
139
145
  request = Net::HTTP::Get.new("/backtraces.txt")
140
- request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
141
- response = instance.http_request("agents.s/server_admin", request)
146
+ try_performing_ro_admin_basic_auth(request, instance)
147
+ response = instance.http_request("agents.s/server_api", request)
142
148
  if response.code.to_i / 100 == 2
143
149
  text = response.body
144
150
  # Colorize output
@@ -146,6 +152,9 @@ def show_status(instance, options)
146
152
  text.gsub!(/^(Thread .*:)$/, color.black_bg + color.yellow + '\1' + color.reset)
147
153
  text.gsub!(/^( +in '.*? )(.*?)\(/, '\1' + color.bold + '\2' + color.reset + '(')
148
154
  puts text
155
+ elsif response.code.to_i == 401
156
+ print_permission_error_message
157
+ exit 2
149
158
  else
150
159
  STDERR.puts "*** An error occured."
151
160
  STDERR.puts "#{response.code}: #{response.body}"
@@ -154,8 +163,8 @@ def show_status(instance, options)
154
163
 
155
164
  when 'xml'
156
165
  request = Net::HTTP::Get.new("/pool.xml?secrets=#{options[:verbose]}")
157
- request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
158
- response = instance.http_request("agents.s/server_admin", request)
166
+ try_performing_ro_admin_basic_auth(request, instance)
167
+ response = instance.http_request("agents.s/server_api", request)
159
168
  if response.code.to_i / 100 == 2
160
169
  indented = format_with_xmllint(response.body)
161
170
  if indented
@@ -164,6 +173,9 @@ def show_status(instance, options)
164
173
  puts response.body
165
174
  STDERR.puts "*** Tip: if you install the 'xmllint' command then the XML output will be indented."
166
175
  end
176
+ elsif response.code.to_i == 401
177
+ print_permission_error_message
178
+ exit 2
167
179
  else
168
180
  STDERR.puts "*** An error occured."
169
181
  STDERR.puts "#{response.code}: #{response.body}"
@@ -172,10 +184,13 @@ def show_status(instance, options)
172
184
 
173
185
  when 'union_station'
174
186
  request = Net::HTTP::Get.new("/status.txt")
175
- request.basic_auth("ro_admin", obtain_read_only_admin_password(instance))
176
- response = instance.http_request("agents.s/logging_admin", request)
187
+ try_performing_ro_admin_basic_auth(request, instance)
188
+ response = instance.http_request("agents.s/logging_api", request)
177
189
  if response.code.to_i / 100 == 2
178
190
  puts response.body
191
+ elsif response.code.to_i == 401
192
+ print_permission_error_message
193
+ exit 2
179
194
  else
180
195
  STDERR.puts "*** An error occured."
181
196
  STDERR.puts "#{response.code}: #{response.body}"
@@ -191,13 +206,13 @@ def print_header(io, instance)
191
206
  io.puts
192
207
  end
193
208
 
194
- def obtain_read_only_admin_password(instance)
209
+ def try_performing_ro_admin_basic_auth(request, instance)
195
210
  begin
196
211
  password = instance.read_only_admin_password
197
212
  rescue Errno::EACCES
198
- print_permission_error_message
199
- exit 2
213
+ return
200
214
  end
215
+ request.basic_auth("ro_admin", password)
201
216
  end
202
217
 
203
218
  def print_permission_error_message
@@ -29,7 +29,8 @@ AGENT_OBJECTS = {
29
29
  'ext/common/agents/Watchdog/HelperAgentWatcher.cpp',
30
30
  'ext/common/agents/Watchdog/LoggingAgentWatcher.cpp',
31
31
  'ext/common/agents/Watchdog/InstanceDirToucher.cpp',
32
- 'ext/common/agents/Watchdog/AdminServer.h',
32
+ 'ext/common/agents/Watchdog/ApiServer.h',
33
+ 'ext/common/agents/ApiServerUtils.h',
33
34
  'ext/common/agents/HelperAgent/OptionParser.h',
34
35
  'ext/common/agents/LoggingAgent/OptionParser.h',
35
36
  'ext/common/ServerKit/Server.h',
@@ -44,7 +45,7 @@ AGENT_OBJECTS = {
44
45
  'ServerMain.o' => [
45
46
  'ext/common/agents/HelperAgent/Main.cpp',
46
47
  'ext/common/agents/HelperAgent/OptionParser.h',
47
- 'ext/common/agents/HelperAgent/AdminServer.h',
48
+ 'ext/common/agents/HelperAgent/ApiServer.h',
48
49
  'ext/common/agents/HelperAgent/ResponseCache.h',
49
50
  'ext/common/agents/HelperAgent/RequestHandler.h',
50
51
  'ext/common/agents/HelperAgent/RequestHandler/Client.h',
@@ -57,20 +58,20 @@ AGENT_OBJECTS = {
57
58
  'ext/common/agents/HelperAgent/RequestHandler/CheckoutSession.cpp',
58
59
  'ext/common/agents/HelperAgent/RequestHandler/SendRequest.cpp',
59
60
  'ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp',
61
+ 'ext/common/agents/ApiServerUtils.h',
60
62
  'ext/common/ServerKit/Server.h',
61
63
  'ext/common/ServerKit/HttpServer.h',
62
64
  'ext/common/ServerKit/HttpHeaderParser.h',
63
65
  'ext/common/ServerKit/AcceptLoadBalancer.h',
64
66
  'ext/common/ServerKit/FileBufferedChannel.h',
65
67
  'ext/common/ApplicationPool2/Pool.h',
66
- 'ext/common/ApplicationPool2/Pool/AnalyticsCollection.h',
67
- 'ext/common/ApplicationPool2/Pool/GarbageCollection.h',
68
- 'ext/common/ApplicationPool2/Pool/GeneralUtils.h',
69
- 'ext/common/ApplicationPool2/Pool/ProcessUtils.h',
70
- 'ext/common/ApplicationPool2/Pool/Inspection.h',
71
- 'ext/common/ApplicationPool2/Pool/Debug.h',
72
68
  'ext/common/ApplicationPool2/Group.h',
73
- 'ext/common/ApplicationPool2/Spawner.h',
69
+ 'ext/common/ApplicationPool2/BasicGroupInfo.h',
70
+ 'ext/common/ApplicationPool2/BasicProcessInfo.h',
71
+ 'ext/common/ApplicationPool2/Context.h',
72
+ 'ext/common/ApplicationPool2/Process.h',
73
+ 'ext/common/ApplicationPool2/Session.h',
74
+ 'ext/common/SpawningKit/Spawner.h',
74
75
  'ext/common/Constants.h',
75
76
  'ext/common/StaticString.h',
76
77
  'ext/common/Account.h',
@@ -86,11 +87,12 @@ AGENT_OBJECTS = {
86
87
  'LoggingMain.o' => [
87
88
  'ext/common/agents/LoggingAgent/Main.cpp',
88
89
  'ext/common/agents/LoggingAgent/OptionParser.h',
89
- 'ext/common/agents/LoggingAgent/AdminServer.h',
90
+ 'ext/common/agents/LoggingAgent/ApiServer.h',
90
91
  'ext/common/agents/LoggingAgent/LoggingServer.h',
91
92
  'ext/common/agents/LoggingAgent/RemoteSender.h',
92
93
  'ext/common/agents/LoggingAgent/DataStoreId.h',
93
94
  'ext/common/agents/LoggingAgent/FilterSupport.h',
95
+ 'ext/common/agents/ApiServerUtils.h',
94
96
  'ext/common/ServerKit/Server.h',
95
97
  'ext/common/ServerKit/HttpServer.h',
96
98
  'ext/common/ServerKit/HttpHeaderParser.h',
@@ -58,46 +58,46 @@ TEST_CXX_OBJECTS = {
58
58
  'test/cxx/ApplicationPool2/OptionsTest.o' => %w(
59
59
  test/cxx/ApplicationPool2/OptionsTest.cpp
60
60
  ext/common/ApplicationPool2/Options.h),
61
- 'test/cxx/ApplicationPool2/DirectSpawnerTest.o' => %w(
62
- test/cxx/ApplicationPool2/DirectSpawnerTest.cpp
63
- test/cxx/ApplicationPool2/SpawnerTestCases.cpp
64
- ext/common/ApplicationPool2/Options.h
65
- ext/common/ApplicationPool2/Process.h
66
- ext/common/ApplicationPool2/Socket.h
67
- ext/common/ApplicationPool2/Spawner.h
68
- ext/common/ApplicationPool2/DirectSpawner.h),
69
- 'test/cxx/ApplicationPool2/SmartSpawnerTest.o' => %w(
70
- test/cxx/ApplicationPool2/SmartSpawnerTest.cpp
71
- test/cxx/ApplicationPool2/SpawnerTestCases.cpp
72
- ext/common/ApplicationPool2/Options.h
73
- ext/common/ApplicationPool2/Process.h
74
- ext/common/ApplicationPool2/Socket.h
75
- ext/common/ApplicationPool2/Spawner.h
76
- ext/common/ApplicationPool2/SmartSpawner.h),
77
61
  'test/cxx/ApplicationPool2/ProcessTest.o' => %w(
78
62
  test/cxx/ApplicationPool2/ProcessTest.cpp
79
63
  ext/common/ApplicationPool2/Process.h
80
64
  ext/common/ApplicationPool2/Socket.h
81
- ext/common/ApplicationPool2/Session.h),
65
+ ext/common/ApplicationPool2/Session.h
66
+ ext/common/SpawningKit/Spawner.h
67
+ ext/common/SpawningKit/DummySpawner.h),
82
68
  'test/cxx/ApplicationPool2/PoolTest.o' => %w(
83
69
  test/cxx/ApplicationPool2/PoolTest.cpp
84
- ext/common/ApplicationPool2/SuperGroup.h
85
- ext/common/ApplicationPool2/Group.h
86
70
  ext/common/ApplicationPool2/Pool.h
87
- ext/common/ApplicationPool2/Pool/AnalyticsCollection.h
88
- ext/common/ApplicationPool2/Pool/GarbageCollection.h
89
- ext/common/ApplicationPool2/Pool/GeneralUtils.h
90
- ext/common/ApplicationPool2/Pool/ProcessUtils.h
91
- ext/common/ApplicationPool2/Pool/Inspection.h
92
- ext/common/ApplicationPool2/Pool/Debug.h
71
+ ext/common/ApplicationPool2/Group.h
72
+ ext/common/ApplicationPool2/BasicGroupInfo.h
73
+ ext/common/ApplicationPool2/BasicProcessInfo.h
74
+ ext/common/ApplicationPool2/Context.h
93
75
  ext/common/ApplicationPool2/Process.h
94
76
  ext/common/ApplicationPool2/Socket.h
95
77
  ext/common/ApplicationPool2/Options.h
96
- ext/common/ApplicationPool2/Spawner.h
97
- ext/common/ApplicationPool2/SpawnerFactory.h
98
- ext/common/ApplicationPool2/SmartSpawner.h
99
- ext/common/ApplicationPool2/DirectSpawner.h
100
- ext/common/ApplicationPool2/DummySpawner.h),
78
+ ext/common/SpawningKit/Spawner.h
79
+ ext/common/SpawningKit/Factory.h
80
+ ext/common/SpawningKit/SmartSpawner.h
81
+ ext/common/SpawningKit/DirectSpawner.h
82
+ ext/common/SpawningKit/DummySpawner.h),
83
+ 'test/cxx/SpawningKit/DirectSpawnerTest.o' => %w(
84
+ test/cxx/SpawningKit/DirectSpawnerTest.cpp
85
+ test/cxx/SpawningKit/SpawnerTestCases.cpp
86
+ ext/common/ApplicationPool2/Options.h
87
+ ext/common/SpawningKit/Config.h
88
+ ext/common/SpawningKit/Options.h
89
+ ext/common/SpawningKit/Result.h
90
+ ext/common/SpawningKit/Spawner.h
91
+ ext/common/SpawningKit/DirectSpawner.h),
92
+ 'test/cxx/SpawningKit/SmartSpawnerTest.o' => %w(
93
+ test/cxx/SpawningKit/SmartSpawnerTest.cpp
94
+ test/cxx/SpawningKit/SpawnerTestCases.cpp
95
+ ext/common/ApplicationPool2/Options.h
96
+ ext/common/SpawningKit/Config.h
97
+ ext/common/SpawningKit/Options.h
98
+ ext/common/SpawningKit/Result.h
99
+ ext/common/SpawningKit/Spawner.h
100
+ ext/common/SpawningKit/SmartSpawner.h),
101
101
  'test/cxx/MemoryKit/MbufTest.o' => %w(
102
102
  test/cxx/MemoryKit/MbufTest.cpp
103
103
  ext/common/MemoryKit/mbuf.h),
@@ -1467,15 +1467,6 @@ Queuing requests and limiting concurrency. Each process tells the ApplicationPoo
1467
1467
  <div class="paragraph"><p>The Pool class is the core of the subsystem. It contains high-level process management logic but not low-level details, such as the details of spawning processes. The code is further divided into the following classes, each of which contain the core code managing its respective domain:</p></div>
1468
1468
  <div class="dlist"><dl>
1469
1469
  <dt class="hdlist1">
1470
- <strong>SuperGroup</strong>
1471
- </dt>
1472
- <dd>
1473
- <p>
1474
- A logical collection of different applications. It’s designed to be able to contain one or more Groups, but currently it always contains exactly 1 Group.
1475
- </p>
1476
- <div class="paragraph"><p>SuperGroup was originally introduced as a building block for a future feature: polyglot, multi-language applications. The idea was that, as more and more programming languages are introduced and become popular, there would be more and more demand to write applications in multiple languages. This would be done by splitting applications into multiple parts, with each part implemented in a different language. We wanted to introduce a feature that makes it super-easy to make such polyglot applications as a single whole. However, as time went on, we realized that we were mistaken and that most developers actually don’t want to bother with multiple programming languages: they’d rather stick with a single one. So nowadays, SuperGroup is actually obsolete, but it’s still kept in the codebase because it’s not harmful, and removing it is too much work.</p></div>
1477
- </dd>
1478
- <dt class="hdlist1">
1479
1470
  <strong>Group</strong>
1480
1471
  </dt>
1481
1472
  <dd>
@@ -1516,7 +1507,7 @@ Queuing requests and limiting concurrency. Each process tells the ApplicationPoo
1516
1507
  </p>
1517
1508
  </dd>
1518
1509
  </dl></div>
1519
- <div class="paragraph"><p>If you look at the diagram, then you see that SuperGroup, Group and Process all have 0..1 associations with their containing classes. An object that has a NULL association with its containing object, is considered invalid and should not be used. The fact that the association can be NULL is a detail of the memory management scheme that we employ.</p></div>
1510
+ <div class="paragraph"><p>If you look at the diagram, then you see that Group and Process all have 0..1 associations with their containing classes. An object that has a NULL association with its containing object, is considered invalid and should not be used. The fact that the association can be NULL is a detail of the memory management scheme that we employ.</p></div>
1520
1511
  </div>
1521
1512
  <div class="sect2">
1522
1513
  <span class="anchor_helper" id="spawner_subsystem"></span><h3 data-anchor="spawner_subsystem">3.3. The Spawner subsystem</h3>