passenger 5.0.23 → 5.0.24
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.
- checksums.yaml +4 -4
- data/CHANGELOG +16 -1
- data/bin/passenger-install-apache2-module +1 -1
- data/build/basics.rb +1 -1
- data/build/cplusplus_support.rb +1 -1
- data/build/integration_tests.rb +1 -1
- data/build/packaging.rb +1 -1
- data/resources/templates/standalone/http.erb +1 -0
- data/src/agent/Core/ApiServer.h +91 -38
- data/src/agent/Core/ApplicationPool/Pool.h +2 -1
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +2 -1
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +28 -1
- data/src/agent/Core/ApplicationPool/Process.h +3 -0
- data/src/agent/Core/Controller/CheckoutSession.cpp +2 -2
- data/src/agent/Core/Controller/ForwardResponse.cpp +1 -1
- data/src/agent/Core/Controller/Request.h +2 -2
- data/src/agent/Core/CoreMain.cpp +3 -2
- data/src/agent/Core/OptionParser.h +5 -0
- data/src/agent/Core/UnionStation/StopwatchLog.h +34 -60
- data/src/agent/UstRouter/ApiServer.h +27 -14
- data/src/apache2_module/Configuration.cpp +6 -0
- data/src/apache2_module/Configuration.hpp +4 -0
- data/src/apache2_module/Hooks.cpp +1 -0
- data/src/cxx_supportlib/Constants.h +3 -1
- data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +1 -1
- data/src/cxx_supportlib/Utils.cpp +1 -1
- data/src/nginx_module/CacheLocationConfig.c +26 -0
- data/src/nginx_module/Configuration.c +5 -0
- data/src/nginx_module/Configuration.h +1 -0
- data/src/nginx_module/ConfigurationCommands.c +10 -0
- data/src/nginx_module/ConfigurationFields.h +2 -0
- data/src/nginx_module/CreateLocationConfig.c +4 -0
- data/src/nginx_module/MergeLocationConfig.c +6 -0
- data/src/nginx_module/ngx_http_passenger_module.c +1 -0
- data/src/ruby_supportlib/phusion_passenger.rb +3 -3
- data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +11 -11
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +3 -3
- data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +30 -10
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +6 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +8 -8
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +22 -9
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +14 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- metadata +3 -2
@@ -73,9 +73,9 @@ APACHE2_DIRECTORY_CONFIGURATION_OPTIONS = [
|
|
73
73
|
:desc => "The Node.js command to use."
|
74
74
|
},
|
75
75
|
{
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
:name => "PassengerMeteorAppSettings",
|
77
|
+
:type => :string,
|
78
|
+
:desc => "Settings file for (non-bundled) Meteor apps."
|
79
79
|
},
|
80
80
|
{
|
81
81
|
:name => "PassengerAppEnv",
|
@@ -209,7 +209,7 @@ module PhusionPassenger
|
|
209
209
|
return false
|
210
210
|
end
|
211
211
|
|
212
|
-
STDERR.puts " [#{library_name}] trying to compile for the current Ruby interpreter..."
|
212
|
+
STDERR.puts " [#{library_name}] trying to compile for the current user (#{current_user_name_or_id}) and Ruby interpreter..."
|
213
213
|
STDERR.puts " (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)"
|
214
214
|
|
215
215
|
require 'fileutils'
|
@@ -224,6 +224,22 @@ module PhusionPassenger
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
227
|
+
# Name of the user under which we are executing, or the id as fallback
|
228
|
+
# N.B. loader_shared_helpers.rb has the same method
|
229
|
+
def current_user_name_or_id
|
230
|
+
require 'etc' if !defined?(Etc)
|
231
|
+
begin
|
232
|
+
user = Etc.getpwuid(Process.uid)
|
233
|
+
rescue ArgumentError
|
234
|
+
user = nil
|
235
|
+
end
|
236
|
+
if user
|
237
|
+
return user.name
|
238
|
+
else
|
239
|
+
return "##{Process.uid}"
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
227
243
|
def installation_target_dirs
|
228
244
|
target_dirs = []
|
229
245
|
if (output_dir = ENV['PASSENGER_NATIVE_SUPPORT_OUTPUT_DIR']) && !output_dir.empty?
|
@@ -310,37 +326,40 @@ module PhusionPassenger
|
|
310
326
|
:unlink_immediately => false)
|
311
327
|
options = { :logger => logger }
|
312
328
|
begin
|
313
|
-
try_directories(target_dirs, options) do |target_dir|
|
314
|
-
|
329
|
+
result = try_directories(target_dirs, options) do |target_dir|
|
330
|
+
make_result = nil
|
315
331
|
# Perform the actual compilation in a temporary directory to avoid
|
316
332
|
# problems with multiple processes trying to concurrently compile.
|
317
333
|
# https://github.com/phusion/passenger/issues/1570
|
318
334
|
PhusionPassenger::Utils.mktmpdir("passenger-native-support-") do |tmpdir|
|
319
335
|
Dir.chdir(tmpdir) do
|
320
|
-
|
336
|
+
make_result =
|
321
337
|
sh_nonfatal("#{PlatformInfo.ruby_command} #{Shellwords.escape extconf_rb}",
|
322
338
|
options) &&
|
323
339
|
sh_nonfatal("make", options)
|
324
|
-
if
|
340
|
+
if make_result
|
325
341
|
begin
|
326
342
|
FileUtils.cp_r(".", target_dir)
|
327
343
|
rescue SystemCallError => e
|
328
344
|
log("Error: #{e}")
|
329
|
-
|
345
|
+
make_result = false
|
330
346
|
end
|
331
347
|
end
|
332
348
|
end
|
333
349
|
end
|
334
|
-
if
|
335
|
-
log "Compilation
|
350
|
+
if make_result
|
351
|
+
log "Compilation successful. The logs are here:"
|
336
352
|
log logger.path
|
337
353
|
[target_dir, false]
|
338
354
|
else
|
339
|
-
log "Warning: compilation didn't succeed. To learn why, read this file:"
|
340
|
-
log logger.path
|
341
355
|
[nil, false]
|
342
356
|
end
|
343
357
|
end
|
358
|
+
if !result
|
359
|
+
log "Warning: compilation didn't succeed. To learn why, read this file:"
|
360
|
+
log logger.path
|
361
|
+
end
|
362
|
+
return result
|
344
363
|
end
|
345
364
|
ensure
|
346
365
|
logger.close if logger
|
@@ -348,6 +367,7 @@ module PhusionPassenger
|
|
348
367
|
|
349
368
|
def try_directories(dirs, options = {})
|
350
369
|
result = nil
|
370
|
+
log("# current user is: #{current_user_name_or_id}", options)
|
351
371
|
dirs.each_with_index do |dir, i|
|
352
372
|
begin
|
353
373
|
mkdir(dir, options)
|
@@ -86,6 +86,12 @@
|
|
86
86
|
|
87
87
|
|
88
88
|
LOCATION_CONFIGURATION_OPTIONS = [
|
89
|
+
{
|
90
|
+
:name => 'passenger_socket_backlog',
|
91
|
+
:type => :integer,
|
92
|
+
:context => [:main],
|
93
|
+
:struct => "NGX_HTTP_MAIN_CONF_OFFSET"
|
94
|
+
},
|
89
95
|
{
|
90
96
|
:name => 'passenger_enabled',
|
91
97
|
:context => [:srv, :loc, :lif],
|
@@ -117,7 +117,7 @@ module PhusionPassenger
|
|
117
117
|
else
|
118
118
|
apache2ctl = self.apache2ctl
|
119
119
|
end
|
120
|
-
if
|
120
|
+
if os_name_simple == "linux" &&
|
121
121
|
linux_distro_tags.include?(:gentoo) &&
|
122
122
|
apache2ctl == "/usr/sbin/apache2ctl"
|
123
123
|
# On Gentoo, `apache2ctl -V` doesn't forward the command to `apache2 -V`,
|
@@ -582,7 +582,7 @@ module PhusionPassenger
|
|
582
582
|
apxs2_flags = `#{apxs2} -q CFLAGS`.strip << " -I" << `#{apxs2} -q INCLUDEDIR`.strip
|
583
583
|
apxs2_flags.gsub!(/-O\d? /, '')
|
584
584
|
|
585
|
-
if
|
585
|
+
if os_name_simple == "solaris"
|
586
586
|
if (language == :c && !cc_is_sun_studio?) || (language == :cxx && !cxx_is_sun_studio?)
|
587
587
|
# Remove flags not supported by GCC
|
588
588
|
# The big problem is Coolstack apxs includes a bunch of solaris -x directives.
|
@@ -597,7 +597,7 @@ module PhusionPassenger
|
|
597
597
|
end
|
598
598
|
end
|
599
599
|
|
600
|
-
if
|
600
|
+
if os_name_simple == "linux" &&
|
601
601
|
linux_distro_tags.include?(:redhat) &&
|
602
602
|
apxs2 == "/usr/sbin/apxs" &&
|
603
603
|
httpd_architecture_bits == 64
|
@@ -611,7 +611,7 @@ module PhusionPassenger
|
|
611
611
|
apxs2_flags.strip!
|
612
612
|
flags << apxs2_flags
|
613
613
|
end
|
614
|
-
if !httpd.nil? &&
|
614
|
+
if !httpd.nil? && os_name_simple == "macosx"
|
615
615
|
# The default Apache install on OS X is a universal binary.
|
616
616
|
# Figure out which architectures it's compiled for and do the same
|
617
617
|
# thing for mod_passenger. We use the 'file' utility to do this.
|
@@ -742,7 +742,7 @@ module PhusionPassenger
|
|
742
742
|
flags = `#{apr_config} --cppflags --includes`.strip
|
743
743
|
libs = `#{apr_config} --link-ld`.strip
|
744
744
|
flags.gsub!(/-O\d? /, '')
|
745
|
-
if
|
745
|
+
if os_name_simple == "solaris"
|
746
746
|
if (language == :c && !cc_is_sun_studio?) || (language == :cxx && !cxx_is_sun_studio?)
|
747
747
|
# Remove flags not supported by non-Sun Studio compilers
|
748
748
|
flags = flags.split(/ +/).reject do |f|
|
@@ -750,7 +750,7 @@ module PhusionPassenger
|
|
750
750
|
end
|
751
751
|
flags = flags.join(' ')
|
752
752
|
end
|
753
|
-
elsif
|
753
|
+
elsif os_name_simple == "aix"
|
754
754
|
libs << " -Wl,-G -Wl,-brtl"
|
755
755
|
end
|
756
756
|
[flags, libs]
|
@@ -777,7 +777,7 @@ module PhusionPassenger
|
|
777
777
|
flags = `#{apu_config} --includes`.strip
|
778
778
|
libs = `#{apu_config} --link-ld`.strip
|
779
779
|
flags.gsub!(/-O\d? /, '')
|
780
|
-
if
|
780
|
+
if os_name_simple == "solaris"
|
781
781
|
if (language == :c && !cc_is_sun_studio?) || (language == :cxx && !cxx_is_sun_studio?)
|
782
782
|
# Remove flags not supported by non-Sun Studio compilers
|
783
783
|
flags = flags.split(/ +/).reject do |f|
|
@@ -83,7 +83,7 @@ module PhusionPassenger
|
|
83
83
|
else
|
84
84
|
ruby_arch = cpu_architectures[0]
|
85
85
|
end
|
86
|
-
return "#{ruby_engine}-#{ruby_ext_version}-#{ruby_arch}-#{
|
86
|
+
return "#{ruby_engine}-#{ruby_ext_version}-#{ruby_arch}-#{os_name_simple}"
|
87
87
|
end
|
88
88
|
memoize :ruby_extension_binary_compatibility_id
|
89
89
|
|
@@ -109,7 +109,7 @@ module PhusionPassenger
|
|
109
109
|
# compiling a binary with the system's C++ compiler with its default
|
110
110
|
# options.
|
111
111
|
def self.cxx_binary_compatibility_id
|
112
|
-
if
|
112
|
+
if os_name_simple == "macosx"
|
113
113
|
# RUBY_PLATFORM gives us the kernel version, but we want
|
114
114
|
# the OS X version.
|
115
115
|
os_version_string = `sw_vers -productVersion`.strip
|
@@ -132,7 +132,7 @@ module PhusionPassenger
|
|
132
132
|
os_runtime = nil
|
133
133
|
end
|
134
134
|
|
135
|
-
return [os_arch,
|
135
|
+
return [os_arch, os_name_simple, os_runtime].compact.join("-")
|
136
136
|
end
|
137
137
|
memoize :cxx_binary_compatibility_id
|
138
138
|
end
|
@@ -338,14 +338,14 @@ module PhusionPassenger
|
|
338
338
|
end
|
339
339
|
|
340
340
|
def self.cc_supports_visibility_flag?
|
341
|
-
return false if
|
341
|
+
return false if os_name_simple == "aix"
|
342
342
|
return try_compile("Checking for C compiler '-fvisibility' support",
|
343
343
|
:c, '', '-fvisibility=hidden')
|
344
344
|
end
|
345
345
|
memoize :cc_supports_visibility_flag?, true
|
346
346
|
|
347
347
|
def self.cxx_supports_visibility_flag?
|
348
|
-
return false if
|
348
|
+
return false if os_name_simple == "aix"
|
349
349
|
return try_compile("Checking for C++ compiler '-fvisibility' support",
|
350
350
|
:cxx, '', '-fvisibility=hidden')
|
351
351
|
end
|
@@ -422,7 +422,7 @@ module PhusionPassenger
|
|
422
422
|
# http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00861.html
|
423
423
|
# Warnings should be suppressed with -Wno-attributes.
|
424
424
|
def self.cc_visibility_flag_generates_warnings?
|
425
|
-
if
|
425
|
+
if os_name_simple == "linux" && `#{cc} -v 2>&1` =~ /gcc version (.*?)/
|
426
426
|
return $1 <= "4.1.2"
|
427
427
|
else
|
428
428
|
return false
|
@@ -431,7 +431,7 @@ module PhusionPassenger
|
|
431
431
|
memoize :cc_visibility_flag_generates_warnings?, true
|
432
432
|
|
433
433
|
def self.cxx_visibility_flag_generates_warnings?
|
434
|
-
if
|
434
|
+
if os_name_simple == "linux" && `#{cxx} -v 2>&1` =~ /gcc version (.*?)/
|
435
435
|
return $1 <= "4.1.2"
|
436
436
|
else
|
437
437
|
return false
|
@@ -455,7 +455,7 @@ module PhusionPassenger
|
|
455
455
|
def self.cxx_11_flag
|
456
456
|
# C++11 support on FreeBSD 10.0 + Clang seems to be bugged.
|
457
457
|
# http://llvm.org/bugs/show_bug.cgi?id=18310
|
458
|
-
return nil if
|
458
|
+
return nil if os_name_simple == "freebsd"
|
459
459
|
|
460
460
|
source = %{
|
461
461
|
struct Foo {
|
@@ -517,7 +517,7 @@ module PhusionPassenger
|
|
517
517
|
if !ENV['DMALLOC_LIBS'].to_s.empty?
|
518
518
|
return ENV['DMALLOC_LIBS']
|
519
519
|
end
|
520
|
-
if
|
520
|
+
if os_name_simple == "macosx"
|
521
521
|
['/opt/local', '/usr/local', '/usr'].each do |prefix|
|
522
522
|
filename = "#{prefix}/lib/libdmallocthcxx.a"
|
523
523
|
if File.exist?(filename)
|
@@ -532,7 +532,7 @@ module PhusionPassenger
|
|
532
532
|
memoize :dmalloc_ldflags
|
533
533
|
|
534
534
|
def self.electric_fence_ldflags
|
535
|
-
if
|
535
|
+
if os_name_simple == "macosx"
|
536
536
|
['/opt/local', '/usr/local', '/usr'].each do |prefix|
|
537
537
|
filename = "#{prefix}/lib/libefence.a"
|
538
538
|
if File.exist?(filename)
|
@@ -547,7 +547,7 @@ module PhusionPassenger
|
|
547
547
|
memoize :electric_fence_ldflags
|
548
548
|
|
549
549
|
def self.export_dynamic_flags
|
550
|
-
if
|
550
|
+
if os_name_simple == "linux"
|
551
551
|
return '-rdynamic'
|
552
552
|
else
|
553
553
|
return nil
|
@@ -166,28 +166,28 @@ module PhusionPassenger
|
|
166
166
|
check_hash_map(flags)
|
167
167
|
end
|
168
168
|
|
169
|
-
if
|
169
|
+
if os_name_simple == "solaris"
|
170
170
|
if send("#{cc_or_cxx}_is_sun_studio?")
|
171
171
|
flags << '-mt'
|
172
172
|
else
|
173
173
|
flags << '-pthreads'
|
174
174
|
end
|
175
|
-
if
|
175
|
+
if os_name_full =~ /solaris2\.11/
|
176
176
|
# skip the _XOPEN_SOURCE and _XPG4_2 definitions in later versions of Solaris / OpenIndiana
|
177
177
|
flags << '-D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
|
178
178
|
else
|
179
179
|
flags << '-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
|
180
|
-
flags << '-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED' if
|
180
|
+
flags << '-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED' if os_name_full =~ /solaris2\.9/
|
181
181
|
end
|
182
|
-
flags << '-DBOOST_HAS_STDINT_H' unless
|
182
|
+
flags << '-DBOOST_HAS_STDINT_H' unless os_name_full =~ /solaris2\.9/
|
183
183
|
if send("#{cc_or_cxx}_is_sun_studio?")
|
184
184
|
flags << '-xtarget=ultra' if RUBY_PLATFORM =~ /sparc/
|
185
185
|
else
|
186
186
|
flags << '-mcpu=ultrasparc' if RUBY_PLATFORM =~ /sparc/
|
187
187
|
end
|
188
|
-
elsif
|
188
|
+
elsif os_name_simple == "openbsd"
|
189
189
|
flags << '-DBOOST_HAS_STDINT_H -D_GLIBCPP__PTHREADS'
|
190
|
-
elsif
|
190
|
+
elsif os_name_simple == "aix"
|
191
191
|
flags << '-pthread'
|
192
192
|
flags << '-DOXT_DISABLE_BACKTRACES'
|
193
193
|
elsif RUBY_PLATFORM =~ /(sparc-linux|arm-linux|^arm.*-linux|sh4-linux)/
|
@@ -204,7 +204,7 @@ module PhusionPassenger
|
|
204
204
|
def self.portability_c_or_cxx_ldflags(cc_or_cxx)
|
205
205
|
result = ''
|
206
206
|
result << cxx_11_flag if cc_or_cxx == :cxx && cxx_11_flag
|
207
|
-
if
|
207
|
+
if os_name_simple == "solaris"
|
208
208
|
result << ' -lxnet -lsocket -lnsl -lpthread'
|
209
209
|
else
|
210
210
|
result << ' -lpthread'
|
@@ -220,13 +220,13 @@ module PhusionPassenger
|
|
220
220
|
else
|
221
221
|
case platform
|
222
222
|
when :linux
|
223
|
-
invoke = true if PlatformInfo.
|
223
|
+
invoke = true if PlatformInfo.os_name_simple == "linux"
|
224
224
|
when :freebsd
|
225
|
-
invoke = true if PlatformInfo.
|
225
|
+
invoke = true if PlatformInfo.os_name_simple == "freebsd"
|
226
226
|
when :macosx
|
227
|
-
invoke = true if PlatformInfo.
|
227
|
+
invoke = true if PlatformInfo.os_name_simple == "macosx"
|
228
228
|
when :solaris
|
229
|
-
invoke = true if PlatformInfo.
|
229
|
+
invoke = true if PlatformInfo.os_name_simple == "solaris"
|
230
230
|
when :other_platforms
|
231
231
|
invoke = true
|
232
232
|
end
|
@@ -44,7 +44,7 @@ module PhusionPassenger
|
|
44
44
|
# distributions it is likely compatible with.
|
45
45
|
# Returns nil if the operating system is not Linux.
|
46
46
|
def self.linux_distro_tags
|
47
|
-
if
|
47
|
+
if os_name_simple != "linux"
|
48
48
|
return nil
|
49
49
|
end
|
50
50
|
lsb_release = read_file("/etc/lsb-release")
|
@@ -29,7 +29,7 @@ module PhusionPassenger
|
|
29
29
|
|
30
30
|
module PlatformInfo
|
31
31
|
def self.openssl_extra_cflags
|
32
|
-
if PlatformInfo.
|
32
|
+
if PlatformInfo.os_name_simple == "macosx"
|
33
33
|
if File.exist?("/usr/include/openssl")
|
34
34
|
""
|
35
35
|
else
|
@@ -45,7 +45,7 @@ module PhusionPassenger
|
|
45
45
|
memoize :openssl_extra_cflags
|
46
46
|
|
47
47
|
def self.openssl_extra_ldflags
|
48
|
-
if PlatformInfo.
|
48
|
+
if PlatformInfo.os_name_simple == "macosx"
|
49
49
|
if File.exist?("/usr/include/openssl")
|
50
50
|
""
|
51
51
|
else
|
@@ -28,26 +28,39 @@ PhusionPassenger.require_passenger_lib 'platform_info'
|
|
28
28
|
module PhusionPassenger
|
29
29
|
|
30
30
|
module PlatformInfo
|
31
|
-
# Returns the operating system's name
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
|
31
|
+
# Returns the operating system's name in as simple a form as possible. For example,
|
32
|
+
# Linux is always identified as "linux". OS X is always identified as "macosx" (despite
|
33
|
+
# the actual os name being something like "darwin"). This is useful as a stable indicator
|
34
|
+
# of the os without having to worry about version numbers, etc.
|
35
|
+
# N.B. unrecognized os names will just be returned as-is.
|
36
|
+
def self.os_name_simple
|
36
37
|
if rb_config['target_os'] =~ /darwin/ && (sw_vers = find_command('sw_vers'))
|
37
38
|
'macosx'
|
38
39
|
elsif rb_config['target_os'] =~ /^linux-/
|
39
40
|
'linux'
|
40
41
|
elsif rb_config['target_os'] =~ /solaris/
|
41
42
|
'solaris'
|
43
|
+
elsif rb_config['target_os'] =~ /freebsd/
|
44
|
+
'freebsd'
|
45
|
+
elsif rb_config['target_os'] =~ /aix/
|
46
|
+
'aix'
|
42
47
|
else
|
43
48
|
rb_config['target_os']
|
44
49
|
end
|
45
50
|
end
|
46
|
-
memoize :
|
51
|
+
memoize :os_name_simple
|
52
|
+
|
53
|
+
# Returns the operating system's name exactly as advertised by the system. While it is
|
54
|
+
# in lowercase and contains no spaces, it can contain things like version number or
|
55
|
+
# may be less intuitive (e.g. "darwin" for OS X).
|
56
|
+
def self.os_name_full
|
57
|
+
rb_config['target_os']
|
58
|
+
end
|
59
|
+
memoize :os_name_full
|
47
60
|
|
48
61
|
# The current platform's shared library extension ('so' on most Unices).
|
49
62
|
def self.library_extension
|
50
|
-
if
|
63
|
+
if os_name_simple == "macosx"
|
51
64
|
return "bundle"
|
52
65
|
else
|
53
66
|
return "so"
|
@@ -100,7 +113,7 @@ module PhusionPassenger
|
|
100
113
|
def self.cpu_architectures
|
101
114
|
uname = uname_command
|
102
115
|
raise "The 'uname' command cannot be found" if !uname
|
103
|
-
if
|
116
|
+
if os_name_simple == "macosx"
|
104
117
|
arch = `#{uname} -p`.strip
|
105
118
|
if arch == "i386"
|
106
119
|
# Macs have been x86 since around 2007. I think all of them come with
|
@@ -152,7 +165,7 @@ module PhusionPassenger
|
|
152
165
|
|
153
166
|
# Returns whether the flock() function is supported on this OS.
|
154
167
|
def self.supports_flock?
|
155
|
-
defined?(File::LOCK_EX) &&
|
168
|
+
defined?(File::LOCK_EX) && os_name_simple != 'solaris'
|
156
169
|
end
|
157
170
|
|
158
171
|
# Returns whether the OS's main CPU architecture supports the
|
@@ -424,7 +424,7 @@ module PhusionPassenger
|
|
424
424
|
|
425
425
|
private
|
426
426
|
def self.locate_ruby_tool_by_basename(name)
|
427
|
-
if
|
427
|
+
if os_name_simple == "macosx" &&
|
428
428
|
ruby_command =~ %r(\A/System/Library/Frameworks/Ruby.framework/Versions/.*?/usr/bin/ruby\Z)
|
429
429
|
# On OS X we must look for Ruby binaries in /usr/bin.
|
430
430
|
# RubyGems puts executables (e.g. 'rake') in there, not in
|
@@ -122,7 +122,7 @@ module Signal
|
|
122
122
|
def self.list_trappable
|
123
123
|
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
|
124
124
|
case ruby_engine
|
125
|
-
when
|
125
|
+
when /jruby/
|
126
126
|
result = Signal.list.dup
|
127
127
|
result.delete("QUIT")
|
128
128
|
result.delete("ILL")
|
@@ -130,7 +130,6 @@ module Signal
|
|
130
130
|
result.delete("SEGV")
|
131
131
|
result.delete("USR1")
|
132
132
|
result.delete("IOT")
|
133
|
-
result.delete("EXIT")
|
134
133
|
else
|
135
134
|
result = Signal.list.dup
|
136
135
|
result.delete("ALRM")
|
@@ -146,6 +145,7 @@ module Signal
|
|
146
145
|
# Ruby engine.
|
147
146
|
result.delete("STOP")
|
148
147
|
result.delete("KILL")
|
148
|
+
result.delete("EXIT")
|
149
149
|
|
150
150
|
return result
|
151
151
|
end
|