passenger 5.0.10 → 5.0.11

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 (124) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/CHANGELOG +18 -0
  5. data/CONTRIBUTING.md +3 -3
  6. data/bin/passenger-status +12 -4
  7. data/build/agents.rb +45 -45
  8. data/build/apache2.rb +1 -1
  9. data/build/basics.rb +1 -1
  10. data/build/cxx_tests.rb +12 -12
  11. data/doc/CloudLicensingConfiguration.html +10 -10
  12. data/doc/CloudLicensingConfiguration.txt.md +10 -10
  13. data/doc/DebuggingAndStressTesting.md +3 -3
  14. data/doc/Design and Architecture.html +30 -30
  15. data/doc/Design and Architecture.txt +28 -28
  16. data/doc/ServerOptimizationGuide.html +3 -3
  17. data/doc/ServerOptimizationGuide.txt.md +3 -3
  18. data/doc/Users guide Apache.html +24 -12
  19. data/doc/Users guide Apache.txt +2 -2
  20. data/doc/Users guide Nginx.html +24 -12
  21. data/doc/Users guide Nginx.txt +2 -2
  22. data/doc/Users guide Standalone.html +18 -6
  23. data/doc/images/passenger_architecture.png +0 -0
  24. data/doc/images/passenger_architecture.svg +10 -9
  25. data/doc/images/{helper_agent_core_architecture.png → passenger_core_architecture.png} +0 -0
  26. data/doc/users_guide_snippets/environment_variables.txt +1 -1
  27. data/doc/users_guide_snippets/installation/verify_running_epilogue.txt +1 -1
  28. data/doc/users_guide_snippets/support_information.txt +1 -1
  29. data/doc/users_guide_snippets/tips.txt +2 -2
  30. data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +1 -1
  31. data/ext/apache2/Bucket.h +5 -5
  32. data/ext/apache2/Configuration.cpp +1 -1
  33. data/ext/apache2/Configuration.hpp +2 -3
  34. data/ext/apache2/ConfigurationFields.hpp +3 -0
  35. data/ext/apache2/ConfigurationFields.hpp.erb +3 -0
  36. data/ext/apache2/Hooks.cpp +42 -34
  37. data/ext/common/Account.h +3 -3
  38. data/ext/common/AgentsStarter.cpp +7 -7
  39. data/ext/common/AgentsStarter.h +20 -20
  40. data/ext/common/ApplicationPool2/Options.h +12 -12
  41. data/ext/common/Constants.h +10 -8
  42. data/ext/common/Logging.cpp +22 -1
  43. data/ext/common/Logging.h +19 -2
  44. data/ext/common/ServerKit/AcceptLoadBalancer.h +3 -3
  45. data/ext/common/ServerKit/Server.h +24 -0
  46. data/ext/common/UnionStation/Connection.h +1 -1
  47. data/ext/common/UnionStation/Core.h +21 -21
  48. data/ext/common/UnionStation/Transaction.h +3 -3
  49. data/ext/common/Utils.cpp +2 -2
  50. data/ext/common/Utils/IOUtils.cpp +5 -1
  51. data/ext/common/{agents → agent}/ApiServerUtils.h +3 -3
  52. data/ext/common/{agents → agent}/Base.cpp +2 -2
  53. data/ext/common/{agents → agent}/Base.h +0 -0
  54. data/ext/common/{agents/HelperAgent → agent/Core}/ApiServer.h +33 -9
  55. data/ext/common/{agents/HelperAgent → agent/Core}/Main.cpp +60 -59
  56. data/ext/common/{agents/HelperAgent → agent/Core}/OptionParser.h +32 -25
  57. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler.h +17 -17
  58. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/AppResponse.h +0 -0
  59. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/BufferBody.cpp +0 -0
  60. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/CheckoutSession.cpp +0 -0
  61. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Client.h +2 -2
  62. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/ForwardResponse.cpp +0 -0
  63. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Hooks.cpp +0 -0
  64. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/InitRequest.cpp +4 -3
  65. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Request.h +1 -1
  66. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/SendRequest.cpp +0 -0
  67. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/TurboCaching.h +1 -1
  68. data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Utils.cpp +0 -0
  69. data/ext/common/{agents/HelperAgent → agent/Core}/ResponseCache.h +0 -0
  70. data/ext/common/{agents → agent}/Main.cpp +9 -9
  71. data/ext/common/{agents → agent}/SpawnPreparer/Main.cpp +0 -0
  72. data/ext/common/{agents/HelperAgent/SystemMetricsTool.cpp → agent/SystemMetrics/Main.cpp} +0 -0
  73. data/ext/common/{agents → agent}/TempDirToucher/Main.cpp +0 -0
  74. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/ApiServer.h +7 -7
  75. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/DataStoreId.h +0 -0
  76. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/FilterSupport.cpp +0 -0
  77. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/FilterSupport.h +0 -0
  78. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/LoggingServer.h +4 -4
  79. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/Main.cpp +45 -45
  80. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/OptionParser.h +20 -20
  81. data/ext/common/{agents/LoggingAgent → agent/UstRouter}/RemoteSender.h +0 -0
  82. data/ext/common/{agents → agent}/Watchdog/AgentWatcher.cpp +0 -0
  83. data/ext/common/{agents → agent}/Watchdog/ApiServer.h +1 -1
  84. data/ext/common/{agents/Watchdog/HelperAgentWatcher.cpp → agent/Watchdog/CoreWatcher.cpp} +14 -10
  85. data/ext/common/{agents → agent}/Watchdog/InstanceDirToucher.cpp +0 -0
  86. data/ext/common/{agents → agent}/Watchdog/Main.cpp +131 -75
  87. data/ext/common/{agents/Watchdog/LoggingAgentWatcher.cpp → agent/Watchdog/UstRouterWatcher.cpp} +13 -9
  88. data/ext/nginx/CacheLocationConfig.c +11 -6
  89. data/ext/nginx/CacheLocationConfig.c.erb +11 -6
  90. data/ext/nginx/Configuration.c +22 -7
  91. data/ext/nginx/Configuration.h +1 -19
  92. data/ext/nginx/ConfigurationFields.h +19 -0
  93. data/ext/nginx/ConfigurationFields.h.erb +19 -0
  94. data/ext/nginx/ContentHandler.c +33 -33
  95. data/ext/nginx/CreateLocationConfig.c +3 -1
  96. data/ext/nginx/CreateLocationConfig.c.erb +3 -1
  97. data/ext/nginx/MergeLocationConfig.c +8 -4
  98. data/ext/nginx/MergeLocationConfig.c.erb +7 -3
  99. data/ext/nginx/ngx_http_passenger_module.c +33 -42
  100. data/helper-scripts/backtrace-sanitizer.rb +2 -2
  101. data/lib/phusion_passenger.rb +1 -1
  102. data/lib/phusion_passenger/admin_tools/instance.rb +2 -2
  103. data/lib/phusion_passenger/admin_tools/instance_registry.rb +7 -3
  104. data/lib/phusion_passenger/common_library.rb +8 -8
  105. data/lib/phusion_passenger/config/about_command.rb +1 -1
  106. data/lib/phusion_passenger/config/api_call_command.rb +3 -3
  107. data/lib/phusion_passenger/config/installation_utils.rb +34 -21
  108. data/lib/phusion_passenger/config/reopen_logs_command.rb +2 -2
  109. data/lib/phusion_passenger/config/restart_app_command.rb +18 -4
  110. data/lib/phusion_passenger/constants.rb +7 -5
  111. data/lib/phusion_passenger/loader_shared_helpers.rb +2 -6
  112. data/lib/phusion_passenger/message_client.rb +8 -8
  113. data/lib/phusion_passenger/platform_info/ruby.rb +1 -2
  114. data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  115. data/lib/phusion_passenger/request_handler.rb +3 -2
  116. data/lib/phusion_passenger/request_handler/thread_handler.rb +4 -4
  117. data/lib/phusion_passenger/standalone/start_command.rb +13 -3
  118. data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -1
  119. data/lib/phusion_passenger/union_station/core.rb +18 -18
  120. data/lib/phusion_passenger/union_station/transaction.rb +5 -5
  121. data/resources/oss-binaries.phusionpassenger.com.crt +0 -84
  122. data/resources/templates/standalone/config.erb +1 -0
  123. metadata +40 -40
  124. metadata.gz.asc +7 -7
@@ -69,8 +69,8 @@ module PhusionPassenger
69
69
 
70
70
  def perform_reopen_logs
71
71
  perform_reopen_logs_on("watchdog", "watchdog")
72
- perform_reinherit_logs_on("server", "server_api")
73
- perform_reinherit_logs_on("logger", "logging_api")
72
+ perform_reinherit_logs_on("core", "core_api")
73
+ perform_reinherit_logs_on("UstRouter", "ust_router_api")
74
74
  puts "All done"
75
75
  end
76
76
 
@@ -52,7 +52,8 @@ module PhusionPassenger
52
52
  nl = "\n" + ' ' * 37
53
53
  opts.banner =
54
54
  "Usage 1: passenger-config restart-app <APP PATH PREFIX> [OPTIONS]\n" +
55
- "Usage 2: passenger-config restart-app --name <APP GROUP NAME> [OPTIONS]"
55
+ "Usage 2: passenger-config restart-app . [OPTIONS]\n" +
56
+ "Usage 3: passenger-config restart-app --name <APP GROUP NAME> [OPTIONS]"
56
57
  opts.separator ""
57
58
  opts.separator " Restart an application. The syntax determines how the application that is to"
58
59
  opts.separator " be restarted, will be selected."
@@ -63,7 +64,13 @@ module PhusionPassenger
63
64
  opts.separator " Restarts all apps whose path begin with /webapps, such as /webapps/foo,"
64
65
  opts.separator " /webapps/bar and /webapps123."
65
66
  opts.separator ""
66
- opts.separator " 2. Selects a specific application based on an exact match of its app group"
67
+ opts.separator " 2. Selects all application whose paths fall under the current working"
68
+ opts.separator " directory."
69
+ opts.separator " Example: passenger-config restart-app ."
70
+ opts.separator " If the current working directory is /webapps, restarts all apps whose path"
71
+ opts.separator " begin with /webapps, such as /webapps/foo, /webapps/bar and /webapps123."
72
+ opts.separator ""
73
+ opts.separator " 3. Selects a specific application based on an exact match of its app group"
67
74
  opts.separator " name."
68
75
  opts.separator ""
69
76
  opts.separator " Example: passenger-config restart-app --name /webapps/foo"
@@ -187,6 +194,9 @@ module PhusionPassenger
187
194
  end
188
195
 
189
196
  def select_app_group_name_by_app_root_regex(app_root)
197
+ if app_root == "."
198
+ app_root = Dir.pwd
199
+ end
190
200
  regex = /^#{Regexp.escape(app_root)}/
191
201
  query_pool_xml.elements.each("info/supergroups/supergroup/group") do |group|
192
202
  if group.elements["app_root"].text =~ regex
@@ -240,8 +250,12 @@ module PhusionPassenger
240
250
  if response.code.to_i / 100 == 2
241
251
  REXML::Document.new(response.body)
242
252
  elsif response.code.to_i == 401
243
- print_instance_querying_permission_error
244
- abort
253
+ if response["pool-empty"] == "true"
254
+ REXML::Document.new('<?xml version="1.0" encoding="iso8859-1"?><info version="3"></info>')
255
+ else
256
+ print_instance_querying_permission_error
257
+ abort
258
+ end
245
259
  else
246
260
  STDERR.puts "*** An error occured while querying the #{PROGRAM_NAME} server:"
247
261
  STDERR.puts response.body
@@ -49,6 +49,7 @@ module PhusionPassenger
49
49
  DEFAULT_NODEJS = "node"
50
50
  DEFAULT_MAX_POOL_SIZE = 6
51
51
  DEFAULT_POOL_IDLE_TIME = 300
52
+ DEFAULT_MAX_PRELOADER_IDLE_TIME = 5 * 60
52
53
  DEFAULT_START_TIMEOUT = 90_000
53
54
  DEFAULT_WEB_APP_USER = "nobody"
54
55
  DEFAULT_APP_ENV = "production"
@@ -66,8 +67,8 @@ module PhusionPassenger
66
67
  DEFAULT_UNION_STATION_GATEWAY_ADDRESS = "gateway.unionstationapp.com"
67
68
  DEFAULT_UNION_STATION_GATEWAY_PORT = 443
68
69
  DEFAULT_HTTP_SERVER_LISTEN_ADDRESS = "tcp://127.0.0.1:3000"
69
- DEFAULT_LOGGING_AGENT_LISTEN_ADDRESS = "tcp://127.0.0.1:9344"
70
- DEFAULT_LOGGING_AGENT_API_LISTEN_ADDRESS = "tcp://127.0.0.1:9345"
70
+ DEFAULT_UST_ROUTER_LISTEN_ADDRESS = "tcp://127.0.0.1:9344"
71
+ DEFAULT_UST_ROUTER_API_LISTEN_ADDRESS = "tcp://127.0.0.1:9345"
71
72
 
72
73
  # Size limits
73
74
  MESSAGE_SERVER_MAX_USERNAME_SIZE = 100
@@ -87,8 +88,8 @@ module PhusionPassenger
87
88
  PASSENGER_API_VERSION_MINOR = 2
88
89
  PASSENGER_API_VERSION = "#{PASSENGER_API_VERSION_MAJOR}.#{PASSENGER_API_VERSION_MINOR}"
89
90
  SERVER_INSTANCE_DIR_STRUCTURE_MAJOR_VERSION = 2
90
- SERVER_INSTANCE_DIR_STRUCTURE_MINOR_VERSION = 1
91
- SERVER_INSTANCE_DIR_STRUCTURE_MIN_SUPPORTED_MINOR_VERSION = 1
91
+ SERVER_INSTANCE_DIR_STRUCTURE_MINOR_VERSION = 3
92
+ SERVER_INSTANCE_DIR_STRUCTURE_MIN_SUPPORTED_MINOR_VERSION = 3
92
93
 
93
94
  # Misc
94
95
  FEEDBACK_FD = 3
@@ -121,7 +122,8 @@ module PhusionPassenger
121
122
  "--without-http_uwsgi_module " <<
122
123
  "--with-http_gzip_static_module " <<
123
124
  "--with-http_stub_status_module " <<
124
- "--with-http_ssl_module"
125
+ "--with-http_ssl_module " <<
126
+ "--with-http_realip_module"
125
127
  end
126
128
 
127
129
  SharedConstants.constants.each do |name|
@@ -164,7 +164,7 @@ module PhusionPassenger
164
164
  def dump_system_metrics(options)
165
165
  if dir = ENV['PASSENGER_DEBUG_DIR']
166
166
  # When invoked through Passenger Standalone, we want passenger-config
167
- # to use the HelperAgent in the Passsenger Standalone buildout directory,
167
+ # to use the PassengerAgent in the Passsenger Standalone buildout directory,
168
168
  # because the one in the source root may not exist.
169
169
  passenger_config = "#{PhusionPassenger.bin_dir}/passenger-config"
170
170
  if is_ruby_program?(passenger_config)
@@ -291,11 +291,7 @@ module PhusionPassenger
291
291
  # This method is to be called after loading the application code but
292
292
  # before forking a worker process.
293
293
  def after_loading_app_code(options)
294
- # Post-install framework extensions. Possibly preceded by a call to
295
- # PhusionPassenger.install_framework_extensions!
296
- if defined?(::Rails) && !defined?(::Rails::VERSION)
297
- require 'rails/version'
298
- end
294
+ # Do nothing.
299
295
  end
300
296
 
301
297
  def create_socket_address(protocol, address)
@@ -1,6 +1,6 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2014 Phusion
3
+ # Copyright (c) 2010-2015 Phusion
4
4
  #
5
5
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
6
  #
@@ -34,7 +34,7 @@ module PhusionPassenger
34
34
  include Utils
35
35
 
36
36
  # Connect to the given server. By default it connects to the current
37
- # generation's helper server.
37
+ # generation's core.
38
38
  def initialize(username, password, address)
39
39
  @socket = connect_to_server(address)
40
40
  begin
@@ -73,7 +73,7 @@ module PhusionPassenger
73
73
  return !!@channel
74
74
  end
75
75
 
76
- ### HelperAgent methods ###
76
+ ### Passenger core process methods ###
77
77
 
78
78
  def pool_detach_process(pid)
79
79
  write("detach_process", pid)
@@ -123,23 +123,23 @@ module PhusionPassenger
123
123
  end
124
124
  end
125
125
 
126
- def helper_agent_requests
126
+ def core_requests
127
127
  write("requests")
128
128
  check_security_response
129
129
  return read_scalar
130
130
  end
131
131
 
132
- ### HelperAgent BacktracesServer methods ###
132
+ ### Passenger core BacktracesServer methods ###
133
133
 
134
- def helper_agent_backtraces
134
+ def core_backtraces
135
135
  write("backtraces")
136
136
  check_security_response
137
137
  return read_scalar
138
138
  end
139
139
 
140
- ### LoggingAgent AdminServer methods ###
140
+ ### Passenger UstRouter AdminServer methods ###
141
141
 
142
- def logging_agent_status
142
+ def ust_router_status
143
143
  write("status")
144
144
  check_security_response
145
145
  return read_scalar
@@ -221,9 +221,8 @@ module PhusionPassenger
221
221
  def self.rvm_paths
222
222
  if in_rvm?
223
223
  result = []
224
- [ENV['rvm_path'], "~/.rvm", "/usr/local/rvm"].each do |path|
224
+ [ENV['rvm_path'], "#{PhusionPassenger.home_dir}/.rvm", "/usr/local/rvm"].each do |path|
225
225
  next if path.nil?
226
- path = File.expand_path(path)
227
226
  rubies_path = File.join(path, 'rubies')
228
227
  wrappers_path = File.join(path, 'wrappers')
229
228
  gems_path = File.join(path, 'gems')
@@ -123,7 +123,7 @@ module PhusionPassenger
123
123
  File.chmod(0600, socket_filename)
124
124
 
125
125
  # Update the dump information just before telling the preloader that we're
126
- # ready because the HelperAgent will read and memorize this information.
126
+ # ready because the Passenger core will read and memorize this information.
127
127
  LoaderSharedHelpers.dump_all_information(options)
128
128
 
129
129
  puts "!> Ready"
@@ -257,7 +257,7 @@ module PhusionPassenger
257
257
  # when we know EOF is not reached.
258
258
  #
259
259
  # The ApplicationPool infrastructure used to connect to a backend
260
- # process's Unix socket in the helper server process, and then
260
+ # process's Unix socket in the Passenger core process, and then
261
261
  # pass the connection file descriptor to the web server, which
262
262
  # triggers this kernel bug. We used to work around this by using
263
263
  # TCP sockets instead of Unix sockets; TCP sockets can still fail
@@ -265,7 +265,7 @@ module PhusionPassenger
265
265
  # as with Unix sockets.
266
266
  #
267
267
  # This problem no longer applies today. The web server now passes
268
- # all I/O through the HelperAgent, and the bug is no longer
268
+ # all I/O through the Passenger core, and the bug is no longer
269
269
  # triggered. Nevertheless, we keep this function intact so that
270
270
  # if something like this ever happens again, we know why, and we
271
271
  # can easily reactivate the workaround. Or maybe if we just need
@@ -344,6 +344,7 @@ module PhusionPassenger
344
344
 
345
345
  trap('ABRT') do
346
346
  print_status_report
347
+ abort
347
348
  end if trappable_signals.has_key?('ABRT')
348
349
  trap('QUIT') do
349
350
  print_status_report
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2015 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -380,7 +380,7 @@ module PhusionPassenger
380
380
  end
381
381
  rescue Exception
382
382
  # Maybe this exception was raised while communicating
383
- # with the logging agent. If that is the case then
383
+ # with the UstRouter. If that is the case then
384
384
  # transaction.close may also raise an exception, but we're only
385
385
  # interested in the original exception. So if this
386
386
  # situation occurs we must ignore any exceptions raised
@@ -389,9 +389,9 @@ module PhusionPassenger
389
389
  raise
390
390
  ensure
391
391
  # It is important that the following call receives an ACK
392
- # from the logging agent and that we don't close the socket
392
+ # from the UstRouter and that we don't close the socket
393
393
  # connection until the ACK has been received, otherwise
394
- # the helper agent may close the transaction before this
394
+ # the Passenger core may close the transaction before this
395
395
  # process's openTransaction command is processed.
396
396
  begin
397
397
  transaction.close
@@ -165,7 +165,7 @@ module PhusionPassenger
165
165
  end
166
166
  opts.on("--data-buffer-dir PATH", String,
167
167
  "Use the given data buffer directory") do |value|
168
- # relative values OK (absolutizePath in HelperAgent Main)
168
+ # relative values OK (absolutizePath in Passenger core main)
169
169
  options[:data_buffer_dir] = value
170
170
  end
171
171
 
@@ -252,6 +252,12 @@ module PhusionPassenger
252
252
  "Default: #{DEFAULT_POOL_IDLE_TIME}") do |value|
253
253
  options[:pool_idle_time] = value
254
254
  end
255
+ opts.on("--max-preloader-idle-time SECONDS", Integer,
256
+ "Maximum time that preloader processes may#{nl}" +
257
+ "be idle. A value of 0 means that preloader#{nl}" +
258
+ "processes never timeout. Default: #{DEFAULT_MAX_PRELOADER_IDLE_TIME}") do |value|
259
+ options[:max_preloader_idle_time] = value
260
+ end
255
261
  opts.on("--concurrency-model NAME", String,
256
262
  "The concurrency model to use, either#{nl}" +
257
263
  "'process' or 'thread' (Enterprise only).#{nl}" +
@@ -287,7 +293,8 @@ module PhusionPassenger
287
293
  options[:sticky_sessions_cookie_name] = value
288
294
  end
289
295
  opts.on("--vary-turbocache-by-cookie NAME", String,
290
- "Vary the turbocache by the cookie of the given name") do |value|
296
+ "Vary the turbocache by the cookie of the#{nl}" +
297
+ "given name") do |value|
291
298
  options[:vary_turbocache_by_cookie] = value
292
299
  end
293
300
  opts.on("--disable-turbocaching", "Disable turbocaching") do
@@ -386,7 +393,7 @@ module PhusionPassenger
386
393
  if app_dir
387
394
  begin
388
395
  ConfigUtils.load_local_config_file!(app_dir, @local_options)
389
- rescue ConfigLoadError => e
396
+ rescue ConfigUtils::ConfigLoadError => e
390
397
  abort "*** ERROR: #{e.message}"
391
398
  end
392
399
  end
@@ -554,6 +561,9 @@ module PhusionPassenger
554
561
  else
555
562
  options[:log_file] ||= "#{exec_root}/#{log_basename}"
556
563
  end
564
+
565
+ options[:log_file] = File.expand_path(options[:log_file], exec_root)
566
+ options[:pid_file] = File.expand_path(options[:pid_file], exec_root)
557
567
  end
558
568
 
559
569
  def create_working_dir
@@ -113,7 +113,7 @@ module PhusionPassenger
113
113
  command << " --default-user #{Shellwords.escape user}"
114
114
  end
115
115
 
116
- command << " --BS"
116
+ command << " --BC"
117
117
  command << " --listen #{listen_address}"
118
118
  command << " --no-graceful-exit"
119
119
  add_param(command, :environment, "--environment")
@@ -135,6 +135,7 @@ module PhusionPassenger
135
135
  add_param(command, :max_pool_size, "--max-pool-size")
136
136
  add_param(command, :min_instances, "--min-instances")
137
137
  add_param(command, :pool_idle_time, "--pool-idle-time")
138
+ add_param(command, :max_preloader_idle_time, "--max-preloader-idle-time")
138
139
  add_enterprise_param(command, :concurrency_model, "--concurrency-model")
139
140
  add_enterprise_param(command, :thread_count, "--app-thread-count")
140
141
  add_enterprise_param(command, :max_request_time, "--max-request-time")
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2015 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -40,10 +40,10 @@ module PhusionPassenger
40
40
  include DebugLogging
41
41
 
42
42
  def self.new_from_options(options)
43
- if options["analytics"] && options["logging_agent_address"]
44
- return new(options["logging_agent_address"],
45
- options["logging_agent_username"],
46
- options["logging_agent_password"],
43
+ if options["analytics"] && options["ust_router_address"]
44
+ return new(options["ust_router_address"],
45
+ options["ust_router_username"],
46
+ options["ust_router_password"],
47
47
  options["node_name"])
48
48
  else
49
49
  return nil
@@ -53,8 +53,8 @@ module PhusionPassenger
53
53
  attr_accessor :max_connect_tries
54
54
  attr_accessor :reconnect_timeout
55
55
 
56
- def initialize(logging_agent_address, username, password, node_name)
57
- @server_address = logging_agent_address
56
+ def initialize(ust_router_address, username, password, node_name)
57
+ @server_address = ust_router_address
58
58
  @username = username
59
59
  @password = password
60
60
  if node_name && !node_name.empty?
@@ -120,7 +120,7 @@ module PhusionPassenger
120
120
  connection_lock.reset(@connection.mutex)
121
121
  rescue SystemCallError, IOError
122
122
  @connection.disconnect
123
- warn("Cannot connect to the logging agent at #{@server_address}; " +
123
+ warn("Cannot connect to the UstRouter at #{@server_address}; " +
124
124
  "retrying in #{@reconnect_timeout} second(s).")
125
125
  @next_reconnect_time = current_time + @reconnect_timeout
126
126
  return Transaction.new
@@ -139,12 +139,12 @@ module PhusionPassenger
139
139
  true)
140
140
  result = @connection.channel.read
141
141
  if result != ["ok"]
142
- raise "Expected logging server to respond with 'ok', but got #{result.inspect} instead"
142
+ raise "Expected the UstRouter to respond with 'ok', but got #{result.inspect} instead"
143
143
  end
144
144
  return Transaction.new(@connection, txn_id)
145
145
  rescue SystemCallError, IOError
146
146
  @connection.disconnect
147
- warn("The logging agent at #{@server_address}" <<
147
+ warn("The UstRouter at #{@server_address}" <<
148
148
  " closed the connection; will reconnect in " <<
149
149
  "#{@reconnect_timeout} second(s).")
150
150
  @next_reconnect_time = current_time + @reconnect_timeout
@@ -176,7 +176,7 @@ module PhusionPassenger
176
176
  connection_lock.reset(@connection.mutex)
177
177
  rescue SystemCallError, IOError
178
178
  @connection.disconnect
179
- warn("Cannot connect to the logging agent at #{@server_address}; " +
179
+ warn("Cannot connect to the UstRouter at #{@server_address}; " +
180
180
  "retrying in #{@reconnect_timeout} second(s).")
181
181
  @next_reconnect_time = current_time + @reconnect_timeout
182
182
  return Transaction.new
@@ -195,7 +195,7 @@ module PhusionPassenger
195
195
  return Transaction.new(@connection, txn_id)
196
196
  rescue SystemCallError, IOError
197
197
  @connection.disconnect
198
- warn("The logging agent at #{@server_address}" <<
198
+ warn("The UstRouter at #{@server_address}" <<
199
199
  " closed the connection; will reconnect in " <<
200
200
  "#{@reconnect_timeout} second(s).")
201
201
  @next_reconnect_time = current_time + @reconnect_timeout
@@ -223,9 +223,9 @@ module PhusionPassenger
223
223
  if result.nil?
224
224
  raise EOFError
225
225
  elsif result.size != 2 || result[0] != "version"
226
- raise IOError, "The logging agent didn't sent a valid version identifier"
226
+ raise IOError, "The UstRouter didn't sent a valid version identifier"
227
227
  elsif result[1] != "1"
228
- raise IOError, "Unsupported logging agent protocol version #{result[1]}"
228
+ raise IOError, "Unsupported UstRouter protocol version #{result[1]}"
229
229
  end
230
230
 
231
231
  channel.write_scalar(@username)
@@ -241,13 +241,13 @@ module PhusionPassenger
241
241
  channel.write("init", @node_name)
242
242
  args = channel.read
243
243
  if !args
244
- raise Errno::ECONNREFUSED, "Cannot connect to logging agent"
244
+ raise Errno::ECONNREFUSED, "Cannot connect to UstRouter"
245
245
  elsif args.size != 1
246
- raise IOError, "Logging agent returned an invalid reply for the 'init' command"
246
+ raise IOError, "UstRouter returned an invalid reply for the 'init' command"
247
247
  elsif args[0] == "server shutting down"
248
- raise Errno::ECONNREFUSED, "Cannot connect to logging agent"
248
+ raise Errno::ECONNREFUSED, "Cannot connect to UstRouter"
249
249
  elsif args[0] != "ok"
250
- raise IOError, "Logging agent returned an invalid reply for the 'init' command"
250
+ raise IOError, "UstRouter returned an invalid reply for the 'init' command"
251
251
  end
252
252
 
253
253
  @connection.unref
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2015 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -60,7 +60,7 @@ module PhusionPassenger
60
60
  @connection.channel.write_scalar(text)
61
61
  rescue SystemCallError, IOError => e
62
62
  @connection.disconnect
63
- warn("Error communicating with the logging agent: #{e.message}")
63
+ warn("Error communicating with the UstRouter: #{e.message}")
64
64
  rescue Exception => e
65
65
  @connection.disconnect
66
66
  raise e
@@ -125,18 +125,18 @@ module PhusionPassenger
125
125
  Core.timestamp_string, true)
126
126
  result = @connection.channel.read
127
127
  if result != ["ok"]
128
- raise "Expected logging agent to respond with 'ok', but got #{result.inspect} instead"
128
+ raise "Expected UstRouter to respond with 'ok', but got #{result.inspect} instead"
129
129
  end
130
130
  if flush_to_disk
131
131
  @connection.channel.write("flush")
132
132
  result = @connection.channel.read
133
133
  if result != ["ok"]
134
- raise "Invalid logging agent response #{result.inspect} to the 'flush' command"
134
+ raise "Invalid UstRouter response #{result.inspect} to the 'flush' command"
135
135
  end
136
136
  end
137
137
  rescue SystemCallError, IOError => e
138
138
  @connection.disconnect
139
- warn("Error communicating with the logging agent: #{e.message}")
139
+ warn("Error communicating with the UstRouter: #{e.message}")
140
140
  rescue Exception => e
141
141
  @connection.disconnect
142
142
  raise e