passenger 4.0.5 → 4.0.6

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 (162) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.travis.yml +1 -2
  3. data/CONTRIBUTING.md +20 -5
  4. data/CONTRIBUTORS +67 -0
  5. data/LICENSE +1 -1
  6. data/NEWS +48 -0
  7. data/Rakefile +2 -2
  8. data/bin/passenger-config +18 -0
  9. data/bin/passenger-install-apache2-module +2 -0
  10. data/bin/passenger-install-nginx-module +11 -12
  11. data/bin/passenger-memory-stats +2 -0
  12. data/bin/passenger-status +152 -69
  13. data/build/agents.rb +1 -5
  14. data/build/basics.rb +26 -13
  15. data/build/cplusplus_support.rb +9 -0
  16. data/build/debian.rb +129 -0
  17. data/build/documentation.rb +6 -2
  18. data/build/integration_tests.rb +13 -2
  19. data/build/misc.rb +16 -0
  20. data/build/packaging.rb +67 -51
  21. data/build/preprocessor.rb +314 -0
  22. data/build/test_basics.rb +1 -0
  23. data/{debian → debian.template}/README.Debian +0 -0
  24. data/{debian → debian.template}/changelog +131 -0
  25. data/debian.template/compat +1 -0
  26. data/debian.template/control +71 -0
  27. data/debian.template/copyright +385 -0
  28. data/debian.template/libapache2-mod-passenger.install +3 -0
  29. data/{debian → debian.template}/libapache2-mod-passenger.postinst +0 -0
  30. data/{debian → debian.template}/libapache2-mod-passenger.prerm +0 -0
  31. data/debian.template/locations.ini +12 -0
  32. data/debian.template/passenger.conf +4 -0
  33. data/{debian → debian.template}/passenger.load +0 -0
  34. data/debian.template/patches/series +0 -0
  35. data/debian.template/repack.sh +42 -0
  36. data/debian.template/ruby-passenger-dev.install +3 -0
  37. data/debian.template/ruby-passenger-doc.install +2 -0
  38. data/debian.template/ruby-passenger.docs +4 -0
  39. data/debian.template/ruby-passenger.install +11 -0
  40. data/debian.template/ruby-passenger.manpages +4 -0
  41. data/debian.template/rules.template +35 -0
  42. data/debian.template/source/format +1 -0
  43. data/debian.template/watch +3 -0
  44. data/dev/run_travis.sh +46 -46
  45. data/doc/Architectural overview.html +2 -2
  46. data/doc/Packaging.html +27 -18
  47. data/doc/Packaging.txt.md +27 -18
  48. data/doc/Security of user switching support.html +2 -2
  49. data/doc/Users guide Apache.html +881 -95
  50. data/doc/Users guide Apache.idmap.txt +48 -6
  51. data/doc/Users guide Apache.txt +13 -1
  52. data/doc/Users guide Nginx.html +1063 -190
  53. data/doc/Users guide Nginx.idmap.txt +89 -45
  54. data/doc/Users guide Nginx.txt +45 -0
  55. data/doc/Users guide Standalone.html +7 -7
  56. data/doc/users_guide_snippets/alternative_for_flying_passenger.txt +1 -0
  57. data/doc/users_guide_snippets/environment_variables.txt +221 -0
  58. data/doc/users_guide_snippets/installation.txt +66 -17
  59. data/doc/users_guide_snippets/support_information.txt +3 -3
  60. data/doc/users_guide_snippets/tips.txt +352 -40
  61. data/ext/common/Account.h +4 -3
  62. data/ext/common/AccountsDatabase.h +6 -6
  63. data/ext/common/AgentsStarter.h +1 -13
  64. data/ext/common/ApplicationPool2/DirectSpawner.h +4 -4
  65. data/ext/common/ApplicationPool2/DummySpawner.h +1 -1
  66. data/ext/common/ApplicationPool2/Group.h +9 -4
  67. data/ext/common/ApplicationPool2/Implementation.cpp +6 -1
  68. data/ext/common/ApplicationPool2/Options.h +65 -37
  69. data/ext/common/ApplicationPool2/Pool.h +91 -41
  70. data/ext/common/ApplicationPool2/Process.h +6 -6
  71. data/ext/common/ApplicationPool2/SmartSpawner.h +14 -14
  72. data/ext/common/ApplicationPool2/Socket.h +1 -1
  73. data/ext/common/ApplicationPool2/Spawner.h +24 -16
  74. data/ext/common/ApplicationPool2/SpawnerFactory.h +9 -1
  75. data/ext/common/ApplicationPool2/SuperGroup.h +1 -1
  76. data/ext/common/Constants.h +1 -1
  77. data/ext/common/Logging.cpp +12 -7
  78. data/ext/common/MessageServer.h +7 -12
  79. data/ext/common/MultiLibeio.cpp +5 -5
  80. data/ext/common/ResourceLocator.h +2 -6
  81. data/ext/common/ServerInstanceDir.h +37 -10
  82. data/ext/common/UnionStation.h +10 -10
  83. data/ext/common/Utils.cpp +30 -4
  84. data/ext/common/Utils.h +7 -0
  85. data/ext/common/Utils/BlockingQueue.h +2 -2
  86. data/ext/common/Utils/Lock.h +2 -2
  87. data/ext/common/Utils/MessagePassing.h +2 -2
  88. data/ext/common/Utils/Timer.h +4 -4
  89. data/ext/common/agents/HelperAgent/AgentOptions.h +2 -0
  90. data/ext/common/agents/HelperAgent/Main.cpp +57 -16
  91. data/ext/common/agents/HelperAgent/RequestHandler.h +4 -1
  92. data/ext/common/agents/LoggingAgent/AdminController.h +91 -0
  93. data/ext/common/agents/LoggingAgent/LoggingServer.h +46 -29
  94. data/ext/common/agents/LoggingAgent/Main.cpp +43 -16
  95. data/ext/common/agents/LoggingAgent/RemoteSender.h +7 -7
  96. data/ext/common/agents/Watchdog/AgentWatcher.cpp +11 -11
  97. data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +3 -1
  98. data/ext/common/agents/Watchdog/Main.cpp +62 -0
  99. data/ext/libeio/config.guess +206 -167
  100. data/ext/libeio/config.sub +142 -68
  101. data/ext/libev/config.guess +304 -290
  102. data/ext/libev/config.sub +198 -77
  103. data/ext/nginx/config +4 -0
  104. data/ext/nginx/ngx_http_passenger_module.c +1 -0
  105. data/ext/oxt/implementation.cpp +4 -4
  106. data/lib/phusion_passenger.rb +14 -5
  107. data/lib/phusion_passenger/abstract_installer.rb +41 -0
  108. data/lib/phusion_passenger/admin_tools/server_instance.rb +48 -39
  109. data/lib/phusion_passenger/message_client.rb +31 -7
  110. data/lib/phusion_passenger/native_support.rb +35 -12
  111. data/lib/phusion_passenger/packaging.rb +16 -2
  112. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +6 -31
  113. data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
  114. data/lib/phusion_passenger/preloader_shared_helpers.rb +3 -1
  115. data/lib/phusion_passenger/request_handler.rb +1 -1
  116. data/lib/phusion_passenger/standalone/command.rb +6 -6
  117. data/lib/phusion_passenger/standalone/main.rb +23 -8
  118. data/lib/phusion_passenger/standalone/package_runtime_command.rb +9 -5
  119. data/lib/phusion_passenger/standalone/runtime_installer.rb +9 -10
  120. data/lib/phusion_passenger/standalone/start_command.rb +20 -4
  121. data/resources/templates/installer_common/freebsd9_broken_cxx_runtime.txt.erb +19 -0
  122. data/resources/templates/installer_common/low_amount_of_memory_warning.txt.erb +22 -0
  123. data/resources/templates/standalone/config.erb +3 -2
  124. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +4 -4
  125. data/test/cxx/ApplicationPool2/PoolTest.cpp +1 -1
  126. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +7 -7
  127. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +9 -9
  128. data/test/cxx/EventedBufferedInputTest.cpp +17 -17
  129. data/test/cxx/RequestHandlerTest.cpp +5 -5
  130. data/test/cxx/ServerInstanceDirTest.cpp +3 -1
  131. data/test/cxx/TestSupport.h +4 -4
  132. data/test/cxx/UnionStationTest.cpp +3 -1
  133. data/test/cxx/UtilsTest.cpp +2 -0
  134. data/test/integration_tests/apache2_tests.rb +2 -2
  135. data/test/integration_tests/native_packaging_spec.rb +170 -0
  136. data/test/ruby/spec_helper.rb +0 -1
  137. data/test/stub/apache2/httpd.conf.erb +1 -1
  138. data/test/stub/nginx/nginx.conf.erb +1 -0
  139. data/test/support/apache2_controller.rb +1 -1
  140. data/test/support/placebo-preloader.rb +1 -1
  141. data/test/support/test_helper.rb +5 -2
  142. metadata +32 -26
  143. metadata.gz.asc +7 -7
  144. data/debian/compat +0 -1
  145. data/debian/control +0 -49
  146. data/debian/copyright +0 -20
  147. data/debian/libapache2-mod-passenger.install +0 -1
  148. data/debian/passenger-common.install +0 -4
  149. data/debian/passenger.conf +0 -4
  150. data/debian/prerm +0 -2
  151. data/debian/rules +0 -37
  152. data/debian/watch +0 -3
  153. data/dev/googlecode_upload.py +0 -265
  154. data/ext/common/agents/HelperAgent/BacktracesServer.h +0 -60
  155. data/resources/templates/nginx/not_available_when_natively_packaged.txt.erb +0 -8
  156. data/test/stub/rails3.1/app/assets/javascripts/application.js +0 -9
  157. data/test/stub/rails3.2/app/assets/javascripts/application.js +0 -15
  158. data/test/stub/rails_apps/2.3/mycook/public/javascripts/application.js +0 -2
  159. data/test/stub/rails_apps/2.3/mycook/public/javascripts/controls.js +0 -963
  160. data/test/stub/rails_apps/2.3/mycook/public/javascripts/dragdrop.js +0 -973
  161. data/test/stub/rails_apps/2.3/mycook/public/javascripts/effects.js +0 -1128
  162. data/test/stub/rails_apps/2.3/mycook/public/javascripts/prototype.js +0 -4320
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010, 2011, 2012 Phusion
2
+ # Copyright (c) 2010-2013 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -58,6 +58,7 @@ module Packaging
58
58
  'configure',
59
59
  'Rakefile',
60
60
  'README.md',
61
+ 'CONTRIBUTORS',
61
62
  'CONTRIBUTING.md',
62
63
  'LICENSE',
63
64
  'INSTALL.md',
@@ -70,7 +71,7 @@ module Packaging
70
71
  'bin/*',
71
72
  'doc/**/*',
72
73
  'man/*',
73
- 'debian/*',
74
+ 'debian.template/**/*',
74
75
  'helper-scripts/*',
75
76
  'ext/common/**/*.{cpp,c,h,hpp,md,erb}',
76
77
  'ext/apache2/*.{cpp,h,hpp,c}',
@@ -107,6 +108,19 @@ module Packaging
107
108
  'test/stub/rails_apps/3.0/empty/help/**/*',
108
109
  'test/stub/*.dSYM'
109
110
  ]
111
+
112
+ # Files that should be excluded from the Debian tarball.
113
+ DEBIAN_EXCLUDE_GLOB = [
114
+ "debian.template/**/*",
115
+ ]
116
+
117
+ def self.files
118
+ return Dir[*GLOB] - Dir[*EXCLUDE_GLOB]
119
+ end
120
+
121
+ def self.debian_orig_tarball_files
122
+ return files - Dir[*DEBIAN_EXCLUDE_GLOB]
123
+ end
110
124
  end
111
125
 
112
126
  end # module PhusionPassenger
@@ -29,13 +29,13 @@ require 'phusion_passenger/platform_info/operating_system'
29
29
  module PhusionPassenger
30
30
 
31
31
  module PlatformInfo
32
- # Returns an array of identifiers that describe the current Ruby
32
+ # Returns a string that describes the current Ruby
33
33
  # interpreter's extension binary compatibility. A Ruby extension
34
34
  # compiled for a certain Ruby interpreter can also be loaded on
35
35
  # a different Ruby interpreter with the same binary compatibility
36
- # identifiers.
36
+ # identifier.
37
37
  #
38
- # The identifiers depend on the following factors:
38
+ # The result depends on the following factors:
39
39
  # - Ruby engine name.
40
40
  # - Ruby extension version.
41
41
  # This is not the same as the Ruby language version, which
@@ -89,7 +89,7 @@ module PlatformInfo
89
89
  # Returns an identifier string that describes the current
90
90
  # platform's binary compatibility with regard to C/C++
91
91
  # binaries. Two systems with the same binary compatibility
92
- # identifiers are able to run the same C/C++ binaries.
92
+ # identifiers should be able to run the same C/C++ binaries.
93
93
  #
94
94
  # The the string depends on the following factors:
95
95
  # - The operating system name.
@@ -128,35 +128,10 @@ module PlatformInfo
128
128
  end
129
129
  else
130
130
  os_arch = cpu_architectures[0]
131
-
132
- cpp = find_command('cpp')
133
- if cpp
134
- macros = `#{cpp} -dM < /dev/null`
135
-
136
- # Can be something like "4.3.2"
137
- # or "4.2.1 20070719 (FreeBSD)"
138
- macros =~ /__VERSION__ "(.+)"/
139
- compiler_version = $1
140
- compiler_version.gsub!(/ .*/, '') if compiler_version
141
-
142
- macros =~ /__GXX_ABI_VERSION (.+)$/
143
- cxx_abi_version = $1
144
- else
145
- compiler_version = nil
146
- cxx_abi_version = nil
147
- end
148
-
149
- if compiler_version && cxx_abi_version
150
- os_runtime = "gcc#{compiler_version}-#{cxx_abi_version}"
151
- else
152
- os_runtime = [compiler_version, cxx_abi_version].compact.join("-")
153
- if os_runtime.empty?
154
- os_runtime = `uname -r`.strip
155
- end
156
- end
131
+ os_runtime = nil
157
132
  end
158
133
 
159
- return "#{os_arch}-#{os_name}-#{os_runtime}"
134
+ return [os_arch, os_name, os_runtime].compact.join("-")
160
135
  end
161
136
  memoize :cxx_binary_compatibility_id
162
137
  end
@@ -33,7 +33,7 @@ module PlatformInfo
33
33
  if rb_config['target_os'] =~ /darwin/ && (sw_vers = find_command('sw_vers'))
34
34
  return "macosx"
35
35
  else
36
- return RUBY_PLATFORM.sub(/.*?-/, '')
36
+ return rb_config['target_os']
37
37
  end
38
38
  end
39
39
  memoize :os_name
@@ -71,8 +71,10 @@ module PreloaderSharedHelpers
71
71
  client.flush
72
72
  client.sync = true
73
73
  return [:forked, client]
74
- else
74
+ elsif defined?(NativeSupport)
75
75
  NativeSupport.detach_process(pid)
76
+ else
77
+ Process.detach(pid)
76
78
  end
77
79
  else
78
80
  STDERR.puts "Unknown command '#{command.inspect}'"
@@ -262,7 +262,7 @@ class RequestHandler
262
262
  if @detach_key && @pool_account_username && @pool_account_password
263
263
  client = MessageClient.new(@pool_account_username, @pool_account_password)
264
264
  begin
265
- client.detach(@detach_key)
265
+ client.pool_detach_process_by_key(@detach_key)
266
266
  ensure
267
267
  client.close
268
268
  end
@@ -36,7 +36,8 @@ class Command
36
36
  :max_pool_size => 6,
37
37
  :min_instances => 1,
38
38
  :spawn_method => Kernel.respond_to?(:fork) ? 'smart' : 'direct',
39
- :nginx_version => PREFERRED_NGINX_VERSION
39
+ :nginx_version => PREFERRED_NGINX_VERSION,
40
+ :friendly_error_pages => true
40
41
  }.freeze
41
42
 
42
43
  include Utils
@@ -181,9 +182,8 @@ private
181
182
  def write_nginx_config_file
182
183
  require 'phusion_passenger/platform_info/ruby'
183
184
  require 'phusion_passenger/utils/tmpio'
184
- @temp_dir = PhusionPassenger::Utils.mktmpdir(
185
- "passenger.#{SERVER_INSTANCE_DIR_STRUCTURE_MAJOR_VERSION}.#{SERVER_INSTANCE_DIR_STRUCTURE_MINOR_VERSION}.",
186
- "/tmp")
185
+ @temp_dir = PhusionPassenger::Utils.mktmpdir(
186
+ "passenger-standalone.")
187
187
  @config_filename = "#{@temp_dir}/config"
188
188
  location_config_filename = "#{@temp_dir}/locations.ini"
189
189
  File.chmod(0755, @temp_dir)
@@ -195,14 +195,14 @@ private
195
195
  if debugging?
196
196
  f.puts "agents=#{PhusionPassenger.agents_dir}"
197
197
  else
198
- f.puts "agents=#{@runtime_dirs[:support_dir]}"
198
+ f.puts "agents=#{@runtime_dirs[:support_dir]}/agents"
199
199
  end
200
200
  f.puts "libdir=#{PhusionPassenger.lib_dir}"
201
201
  f.puts "helper_scripts=#{PhusionPassenger.helper_scripts_dir}"
202
202
  f.puts "resources=#{PhusionPassenger.resources_dir}"
203
203
  f.puts "includedir=#{PhusionPassenger.include_dir}"
204
204
  f.puts "doc=#{PhusionPassenger.doc_dir}"
205
- f.puts "rubylib=#{PhusionPassenger.ruby_libdir}"
205
+ f.puts "rubylibdir=#{PhusionPassenger.ruby_libdir}"
206
206
  f.puts "apache2_module=#{PhusionPassenger.apache2_module_path}"
207
207
  f.puts "ruby_extension_source=#{PhusionPassenger.ruby_extension_source_dir}"
208
208
  end
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010-2013 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -82,18 +82,33 @@ class Main
82
82
 
83
83
  private
84
84
  def command_exists?(name)
85
- return COMMANDS.any? do |element|
86
- element[0] == name
87
- end
85
+ return !!find_command_spec(name)
88
86
  end
89
87
 
90
88
  def run_command(name, args = [])
91
- Main.each_command do |command_name, command_class|
92
- if command_name == name
93
- return command_class.new(args).run
89
+ if spec = find_command_spec(name)
90
+ klass = get_command_class(spec)
91
+ klass.require_libs if klass.respond_to?(:require_libs)
92
+ klass.new(args).run
93
+ else
94
+ raise ArgumentError, "Command '#{name}' doesn't exist"
95
+ end
96
+ end
97
+
98
+ def find_command_spec(name)
99
+ COMMANDS.each do |spec|
100
+ if spec[0] == name
101
+ return spec
94
102
  end
95
103
  end
96
- raise ArgumentError, "Command '#{name}' doesn't exist"
104
+ return nil
105
+ end
106
+
107
+ def get_command_class(spec)
108
+ command_name, class_name = spec
109
+ filename = command_name.sub(/-/, '_') + "_command"
110
+ require "phusion_passenger/standalone/#{filename}"
111
+ return Standalone.const_get(class_name)
97
112
  end
98
113
  end
99
114
 
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # Phusion Passenger - https://www.phusionpassenger.com/
2
3
  # Copyright (c) 2010 Phusion
3
4
  #
@@ -20,7 +21,6 @@
20
21
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
23
  # THE SOFTWARE.
23
- require 'phusion_passenger/standalone/command'
24
24
 
25
25
  module PhusionPassenger
26
26
  module Standalone
@@ -29,9 +29,13 @@ class PackageRuntimeCommand < Command
29
29
  def self.description
30
30
  return "Package the Phusion Passenger Standalone runtime."
31
31
  end
32
-
32
+
33
+ def self.require_libs
34
+ require 'phusion_passenger/platform_info/binary_compatibility'
35
+ require 'phusion_passenger/standalone/runtime_installer'
36
+ end
37
+
33
38
  def run
34
- require_platform_info_binary_compatibility
35
39
  destdir = File.expand_path("passenger-standalone")
36
40
  description =
37
41
  "Package the Phusion Passenger Standalone runtime into the specified directory.\n" <<
@@ -42,7 +46,8 @@ class PackageRuntimeCommand < Command
42
46
  @options[:nginx_version] = value
43
47
  end
44
48
  opts.on("--nginx-tarball FILENAME", String,
45
- wrap_desc("Use the given tarball instead of downloading from the Internet")) do |value|
49
+ wrap_desc("Use the given tarball instead of downloading from the Internet. " +
50
+ "This tarball *must* match the version specified by --nginx-version!")) do |value|
46
51
  @options[:nginx_tarball] = value
47
52
  end
48
53
  end
@@ -56,7 +61,6 @@ class PackageRuntimeCommand < Command
56
61
  sh "rm", "-rf", support_dir
57
62
  sh "rm", "-rf", nginx_dir
58
63
 
59
- require 'phusion_passenger/standalone/runtime_installer'
60
64
  installer = RuntimeInstaller.new(
61
65
  :targets => [:nginx, :ruby, :support_binaries],
62
66
  :support_dir => support_dir,
@@ -119,6 +119,8 @@ protected
119
119
  show_welcome_screen
120
120
  end
121
121
  check_dependencies(false) || exit(1)
122
+ check_whether_os_is_broken
123
+ check_whether_system_has_enough_ram
122
124
  puts
123
125
 
124
126
  phase = 1
@@ -224,8 +226,8 @@ private
224
226
 
225
227
  def binary_support_files_should_be_installed?
226
228
  return @targets.include?(:support_binaries) && (
227
- !File.exist?("#{@support_dir}/agents/PassengerHelperAgent") ||
228
- !File.exist?("#{@support_dir}/libout/common/libpassenger_common.a")
229
+ !File.exist?("#{@support_dir}/buildout/agents/PassengerHelperAgent") ||
230
+ !File.exist?("#{@support_dir}/buildout/common/libpassenger_common.a")
229
231
  )
230
232
  end
231
233
 
@@ -487,16 +489,13 @@ private
487
489
  Dir.chdir(PhusionPassenger.source_root) do
488
490
  args = "nginx_without_native_support" +
489
491
  " CACHING=false" +
490
- " OUTPUT_DIR='#{@support_dir}'" +
491
- " AGENT_OUTPUT_DIR='#{@support_dir}'" +
492
- " COMMON_OUTPUT_DIR='#{@support_dir}'" +
493
- " LIBEV_OUTPUT_DIR='#{@support_dir}/libev'" +
494
- " LIBEIO_OUTPUT_DIR='#{@support_dir}/libeio'"
492
+ " OUTPUT_DIR='#{@support_dir}'"
495
493
  run_rake_task!(args) do |progress, total|
496
494
  yield(progress, total, 1, "Compiling Phusion Passenger...")
497
495
  end
498
496
 
499
- system "rm -rf '#{@support_dir}'/{*.o,*.dSYM,libboost_oxt}"
497
+ system "rm -rf '#{@support_dir}'/agents/{*.o,*.dSYM}"
498
+ system "rm -rf '#{@support_dir}'/common/libboost_oxt"
500
499
  system "rm -rf '#{@support_dir}'/*/{*.lo,*.h,*.log,Makefile,libtool,stamp-h1,config.status,.deps}"
501
500
  system "rm -rf '#{@support_dir}'/{libeio,libev}/*.o"
502
501
 
@@ -521,9 +520,9 @@ private
521
520
  command = ""
522
521
  if @targets.include?(:support_binaries)
523
522
  if ENV['PASSENGER_DEBUG'] && !ENV['PASSENGER_DEBUG'].empty?
524
- output_dir = "#{PhusionPassenger.source_root}/libout/common/libpassenger_common"
523
+ output_dir = "#{PhusionPassenger.source_root}/buildout/common/libpassenger_common"
525
524
  else
526
- output_dir = "#{@support_dir}/libpassenger_common"
525
+ output_dir = "#{@support_dir}/common/libpassenger_common"
527
526
  end
528
527
  nginx_libs = COMMON_LIBRARY.only(*NGINX_LIBS_SELECTOR).
529
528
  set_output_dir(output_dir).
@@ -82,6 +82,7 @@ class StartCommand < Command
82
82
  @plugin.call_hook(:nginx_started, @nginx)
83
83
  ########################
84
84
  ########################
85
+ touch_temp_dir_in_background
85
86
  watch_log_files_in_background if should_watch_logs?
86
87
  wait_until_nginx_has_exited
87
88
  rescue Interrupt
@@ -162,6 +163,10 @@ private
162
163
  wrap_desc("Enable deployment error resistance (Enterprise only)")) do
163
164
  @options[:resist_deployment_errors] = true
164
165
  end
166
+ opts.on("--no-friendly-error-pages",
167
+ wrap_desc("Disable passenger_friendly_error_pages")) do
168
+ @options[:friendly_error_pages] = false
169
+ end
165
170
  opts.on("--union-station-gateway HOST:PORT", String,
166
171
  wrap_desc("Specify Union Station Gateway host and port")) do |value|
167
172
  host, port = value.split(":", 2)
@@ -368,7 +373,7 @@ private
368
373
  :nginx_tarball => @options[:nginx_tarball],
369
374
  :binaries_url_root => @options[:binaries_url_root],
370
375
  :plugin => @plugin)
371
- installer.run
376
+ return installer.run
372
377
  end
373
378
 
374
379
  def determine_runtime_dirs
@@ -392,7 +397,7 @@ private
392
397
  :ruby_dir => "#{root}/rubyext-#{PlatformInfo.ruby_extension_binary_compatibility_id}",
393
398
  :nginx_installed => File.exist?(nginx_bin)
394
399
  }
395
- result[:support_dir_installed] = File.exist?(result[:support_dir] + "/PassengerWatchdog")
400
+ result[:support_dir_installed] = File.exist?(result[:support_dir] + "/agents/PassengerWatchdog")
396
401
  result[:everything_installed] = result[:nginx_installed] && result[:support_dir_installed]
397
402
  return result
398
403
  end
@@ -406,8 +411,8 @@ private
406
411
  if !@runtime_dirs[:nginx_installed] && @options[:nginx_bin]
407
412
  error "The given Nginx binary '#{@options[:nginx_bin]}' does not exist."
408
413
  exit 1
409
- else
410
- install_runtime(@runtime_dirs)
414
+ elsif !install_runtime(@runtime_dirs)
415
+ exit 1
411
416
  end
412
417
  end
413
418
  end
@@ -526,6 +531,17 @@ private
526
531
  @interruptable_threads << thread
527
532
  end
528
533
 
534
+ def touch_temp_dir_in_background
535
+ @interruptable_threads << Thread.new do
536
+ while true
537
+ # Touch the temp dir every 30 minutes to prevent
538
+ # /tmp cleaners from removing it.
539
+ sleep 60 * 30
540
+ system("find '#{@temp_dir}' | xargs touch")
541
+ end
542
+ end
543
+ end
544
+
529
545
  def wait_until_nginx_has_exited
530
546
  # Since Nginx is not our child process (it daemonizes or we daemonize)
531
547
  # we cannot use Process.waitpid to wait for it. A busy-sleep-loop with
@@ -0,0 +1,19 @@
1
+ <red>WARNING:</red> <yellow>You may need to upgrade FreeBSD</yellow>
2
+
3
+ There is a bug in the C++ runtime in FreeBSD 9.1-RELEASE. This bug breaks
4
+ Phusion Passenger. At the time this message was written, the bug had already
5
+ been fixed in the stable/9 Subversion branch of FreeBSD. The fix will be
6
+ included in FreeBSD 9.2. If FreeBSD 9.2 is already out, please upgrade to
7
+ FreeBSD 9.2. Otherwise, please upgrade to the stable/9 branch according to the
8
+ upgrade instructions in the FreeBSD Handbook:
9
+
10
+ http://www.freebsd.org/doc/handbook/current-stable.html#stable
11
+
12
+ More information about the bug:
13
+
14
+ http://lists.freebsd.org/pipermail/freebsd-toolchain/2013-January/000692.html
15
+
16
+ If you have already upgraded, please ignore this message and continue.
17
+
18
+ <b>Press Ctrl-C to abort this installer (recommended).</b>
19
+ <b>Press Enter if you want to continue with installation anyway.</b>
@@ -0,0 +1,22 @@
1
+ <banner>Your system does not have a lot of virtual memory</banner>
2
+
3
+ Compiling Phusion Passenger works best when you have at least <%= @required %> MB of virtual
4
+ memory. However your system only has <%= @current %> MB of total virtual memory (<%= @ram %> MB
5
+ RAM, <%= @swap %> MB swap). It is recommended that you temporarily add more swap space
6
+ before proceeding. You can do it as follows:
7
+
8
+ <b>sudo dd if=/dev/zero of=/swap bs=1M count=1024
9
+ sudo mkswap /swap
10
+ sudo swapon /swap</b>
11
+
12
+ See also <b>https://wiki.archlinux.org/index.php/Swap</b> for more information about
13
+ the swap file on Linux.
14
+
15
+ If you cannot activate a swap file (e.g. because you're on OpenVZ, or if you
16
+ don't have root privileges) then you should install Phusion Passenger through
17
+ DEB/RPM packages. Please refer to the manual for more information:
18
+ <b><%= @doc %></b>, section
19
+ "Installation".
20
+
21
+ <b>Press Ctrl-C to abort this installer (recommended).</b>
22
+ <b>Press Enter if you want to continue with installation anyway.</b>
@@ -27,7 +27,6 @@ http {
27
27
  include '<%= PhusionPassenger.resources_dir %>/mime.types';
28
28
  passenger_ruby <%= PlatformInfo.ruby_command %>;
29
29
  passenger_root '<%= location_config_filename %>';
30
- passenger_ctl server_instance_dir '<%= @temp_dir %>';
31
30
  passenger_abort_on_startup_error on;
32
31
  passenger_user_switching off;
33
32
  passenger_max_pool_size <%= @options[:max_pool_size] %>;
@@ -42,7 +41,9 @@ http {
42
41
  <% if debugging? %>passenger_log_level 2;<% end %>
43
42
  <% if @options[:rolling_restarts] %>passenger_rolling_restarts on;<% end %>
44
43
  <% if @options[:resist_deployment_errors] %>passenger_resist_deployment_errors on;<% end %>
45
-
44
+
45
+ <% unless @options[:friendly_error_pages] %>passenger_friendly_error_pages off;<% end %>
46
+
46
47
  <% if @options[:union_station_gateway_address] %>
47
48
  union_station_gateway_address <%= @options[:union_station_gateway_address] %>;
48
49
  union_station_gateway_port <%= @options[:union_station_gateway_port] %>;