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.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/CHANGELOG +18 -0
- data/CONTRIBUTING.md +3 -3
- data/bin/passenger-status +12 -4
- data/build/agents.rb +45 -45
- data/build/apache2.rb +1 -1
- data/build/basics.rb +1 -1
- data/build/cxx_tests.rb +12 -12
- data/doc/CloudLicensingConfiguration.html +10 -10
- data/doc/CloudLicensingConfiguration.txt.md +10 -10
- data/doc/DebuggingAndStressTesting.md +3 -3
- data/doc/Design and Architecture.html +30 -30
- data/doc/Design and Architecture.txt +28 -28
- data/doc/ServerOptimizationGuide.html +3 -3
- data/doc/ServerOptimizationGuide.txt.md +3 -3
- data/doc/Users guide Apache.html +24 -12
- data/doc/Users guide Apache.txt +2 -2
- data/doc/Users guide Nginx.html +24 -12
- data/doc/Users guide Nginx.txt +2 -2
- data/doc/Users guide Standalone.html +18 -6
- data/doc/images/passenger_architecture.png +0 -0
- data/doc/images/passenger_architecture.svg +10 -9
- data/doc/images/{helper_agent_core_architecture.png → passenger_core_architecture.png} +0 -0
- data/doc/users_guide_snippets/environment_variables.txt +1 -1
- data/doc/users_guide_snippets/installation/verify_running_epilogue.txt +1 -1
- data/doc/users_guide_snippets/support_information.txt +1 -1
- data/doc/users_guide_snippets/tips.txt +2 -2
- data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +1 -1
- data/ext/apache2/Bucket.h +5 -5
- data/ext/apache2/Configuration.cpp +1 -1
- data/ext/apache2/Configuration.hpp +2 -3
- data/ext/apache2/ConfigurationFields.hpp +3 -0
- data/ext/apache2/ConfigurationFields.hpp.erb +3 -0
- data/ext/apache2/Hooks.cpp +42 -34
- data/ext/common/Account.h +3 -3
- data/ext/common/AgentsStarter.cpp +7 -7
- data/ext/common/AgentsStarter.h +20 -20
- data/ext/common/ApplicationPool2/Options.h +12 -12
- data/ext/common/Constants.h +10 -8
- data/ext/common/Logging.cpp +22 -1
- data/ext/common/Logging.h +19 -2
- data/ext/common/ServerKit/AcceptLoadBalancer.h +3 -3
- data/ext/common/ServerKit/Server.h +24 -0
- data/ext/common/UnionStation/Connection.h +1 -1
- data/ext/common/UnionStation/Core.h +21 -21
- data/ext/common/UnionStation/Transaction.h +3 -3
- data/ext/common/Utils.cpp +2 -2
- data/ext/common/Utils/IOUtils.cpp +5 -1
- data/ext/common/{agents → agent}/ApiServerUtils.h +3 -3
- data/ext/common/{agents → agent}/Base.cpp +2 -2
- data/ext/common/{agents → agent}/Base.h +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/ApiServer.h +33 -9
- data/ext/common/{agents/HelperAgent → agent/Core}/Main.cpp +60 -59
- data/ext/common/{agents/HelperAgent → agent/Core}/OptionParser.h +32 -25
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler.h +17 -17
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/AppResponse.h +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/BufferBody.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/CheckoutSession.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Client.h +2 -2
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/ForwardResponse.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Hooks.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/InitRequest.cpp +4 -3
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Request.h +1 -1
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/SendRequest.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/TurboCaching.h +1 -1
- data/ext/common/{agents/HelperAgent → agent/Core}/RequestHandler/Utils.cpp +0 -0
- data/ext/common/{agents/HelperAgent → agent/Core}/ResponseCache.h +0 -0
- data/ext/common/{agents → agent}/Main.cpp +9 -9
- data/ext/common/{agents → agent}/SpawnPreparer/Main.cpp +0 -0
- data/ext/common/{agents/HelperAgent/SystemMetricsTool.cpp → agent/SystemMetrics/Main.cpp} +0 -0
- data/ext/common/{agents → agent}/TempDirToucher/Main.cpp +0 -0
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/ApiServer.h +7 -7
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/DataStoreId.h +0 -0
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/FilterSupport.cpp +0 -0
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/FilterSupport.h +0 -0
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/LoggingServer.h +4 -4
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/Main.cpp +45 -45
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/OptionParser.h +20 -20
- data/ext/common/{agents/LoggingAgent → agent/UstRouter}/RemoteSender.h +0 -0
- data/ext/common/{agents → agent}/Watchdog/AgentWatcher.cpp +0 -0
- data/ext/common/{agents → agent}/Watchdog/ApiServer.h +1 -1
- data/ext/common/{agents/Watchdog/HelperAgentWatcher.cpp → agent/Watchdog/CoreWatcher.cpp} +14 -10
- data/ext/common/{agents → agent}/Watchdog/InstanceDirToucher.cpp +0 -0
- data/ext/common/{agents → agent}/Watchdog/Main.cpp +131 -75
- data/ext/common/{agents/Watchdog/LoggingAgentWatcher.cpp → agent/Watchdog/UstRouterWatcher.cpp} +13 -9
- data/ext/nginx/CacheLocationConfig.c +11 -6
- data/ext/nginx/CacheLocationConfig.c.erb +11 -6
- data/ext/nginx/Configuration.c +22 -7
- data/ext/nginx/Configuration.h +1 -19
- data/ext/nginx/ConfigurationFields.h +19 -0
- data/ext/nginx/ConfigurationFields.h.erb +19 -0
- data/ext/nginx/ContentHandler.c +33 -33
- data/ext/nginx/CreateLocationConfig.c +3 -1
- data/ext/nginx/CreateLocationConfig.c.erb +3 -1
- data/ext/nginx/MergeLocationConfig.c +8 -4
- data/ext/nginx/MergeLocationConfig.c.erb +7 -3
- data/ext/nginx/ngx_http_passenger_module.c +33 -42
- data/helper-scripts/backtrace-sanitizer.rb +2 -2
- data/lib/phusion_passenger.rb +1 -1
- data/lib/phusion_passenger/admin_tools/instance.rb +2 -2
- data/lib/phusion_passenger/admin_tools/instance_registry.rb +7 -3
- data/lib/phusion_passenger/common_library.rb +8 -8
- data/lib/phusion_passenger/config/about_command.rb +1 -1
- data/lib/phusion_passenger/config/api_call_command.rb +3 -3
- data/lib/phusion_passenger/config/installation_utils.rb +34 -21
- data/lib/phusion_passenger/config/reopen_logs_command.rb +2 -2
- data/lib/phusion_passenger/config/restart_app_command.rb +18 -4
- data/lib/phusion_passenger/constants.rb +7 -5
- data/lib/phusion_passenger/loader_shared_helpers.rb +2 -6
- data/lib/phusion_passenger/message_client.rb +8 -8
- data/lib/phusion_passenger/platform_info/ruby.rb +1 -2
- data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/lib/phusion_passenger/request_handler.rb +3 -2
- data/lib/phusion_passenger/request_handler/thread_handler.rb +4 -4
- data/lib/phusion_passenger/standalone/start_command.rb +13 -3
- data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -1
- data/lib/phusion_passenger/union_station/core.rb +18 -18
- data/lib/phusion_passenger/union_station/transaction.rb +5 -5
- data/resources/oss-binaries.phusionpassenger.com.crt +0 -84
- data/resources/templates/standalone/config.erb +1 -0
- metadata +40 -40
- metadata.gz.asc +7 -7
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2015 Phusion
|
4
4
|
*
|
5
5
|
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
@@ -36,6 +36,7 @@
|
|
36
36
|
* rake ext/nginx/CreateLocationConfig.c
|
37
37
|
*/
|
38
38
|
|
39
|
+
void generated_set_conf_part(passenger_loc_conf_t *conf) {
|
39
40
|
|
40
41
|
|
41
42
|
|
@@ -201,3 +202,4 @@
|
|
201
202
|
conf->vary_turbocache_by_cookie.len = 0;
|
202
203
|
|
203
204
|
|
205
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2015 Phusion
|
4
4
|
*
|
5
5
|
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
@@ -36,6 +36,7 @@
|
|
36
36
|
* rake ext/nginx/CreateLocationConfig.c
|
37
37
|
*/
|
38
38
|
|
39
|
+
void generated_set_conf_part(passenger_loc_conf_t *conf) {
|
39
40
|
<%
|
40
41
|
require 'phusion_passenger/nginx/config_options'
|
41
42
|
|
@@ -73,3 +74,4 @@ end
|
|
73
74
|
<% raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}" %>
|
74
75
|
<% end %>
|
75
76
|
<% end %>
|
77
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2015 Phusion
|
4
4
|
*
|
5
5
|
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
@@ -36,6 +36,8 @@
|
|
36
36
|
* rake ext/nginx/MergeLocationConfig.c
|
37
37
|
*/
|
38
38
|
|
39
|
+
/* 0: NGX_CONF_ERROR, 1: OK */
|
40
|
+
int generated_merge_part(passenger_loc_conf_t *conf, passenger_loc_conf_t *prev, ngx_conf_t *cf) {
|
39
41
|
|
40
42
|
|
41
43
|
|
@@ -109,7 +111,7 @@
|
|
109
111
|
if (merge_string_array(cf, &prev->base_uris, &conf->base_uris) != NGX_OK) {
|
110
112
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
111
113
|
"cannot merge \"passenger_base_uri\" configurations");
|
112
|
-
return
|
114
|
+
return 0;
|
113
115
|
}
|
114
116
|
|
115
117
|
|
@@ -159,7 +161,7 @@
|
|
159
161
|
if (merge_string_array(cf, &prev->union_station_filters, &conf->union_station_filters) != NGX_OK) {
|
160
162
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
161
163
|
"cannot merge \"union_station_filter\" configurations");
|
162
|
-
return
|
164
|
+
return 0;
|
163
165
|
}
|
164
166
|
|
165
167
|
|
@@ -179,7 +181,7 @@
|
|
179
181
|
if (merge_string_keyval_table(cf, &prev->env_vars, &conf->env_vars) != NGX_OK) {
|
180
182
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
181
183
|
"cannot merge \"passenger_env_var\" configurations");
|
182
|
-
return
|
184
|
+
return 0;
|
183
185
|
}
|
184
186
|
|
185
187
|
|
@@ -261,3 +263,5 @@
|
|
261
263
|
NULL);
|
262
264
|
|
263
265
|
|
266
|
+
return 1;
|
267
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2015 Phusion
|
4
4
|
*
|
5
5
|
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
@@ -36,6 +36,8 @@
|
|
36
36
|
* rake ext/nginx/MergeLocationConfig.c
|
37
37
|
*/
|
38
38
|
|
39
|
+
/* 0: NGX_CONF_ERROR, 1: OK */
|
40
|
+
int generated_merge_part(passenger_loc_conf_t *conf, passenger_loc_conf_t *prev, ngx_conf_t *cf) {
|
39
41
|
<%
|
40
42
|
require 'phusion_passenger/nginx/config_options'
|
41
43
|
|
@@ -99,15 +101,17 @@ end
|
|
99
101
|
if (merge_string_array(cf, &prev-><%= struct_field_for(option) %>, &conf-><%= struct_field_for(option) %>) != NGX_OK) {
|
100
102
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
101
103
|
"cannot merge \"<%= option[:name] %>\" configurations");
|
102
|
-
return
|
104
|
+
return 0;
|
103
105
|
}
|
104
106
|
<% elsif option[:type] == :string_keyval %>
|
105
107
|
if (merge_string_keyval_table(cf, &prev-><%= struct_field_for(option) %>, &conf-><%= struct_field_for(option) %>) != NGX_OK) {
|
106
108
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
107
109
|
"cannot merge \"<%= option[:name] %>\" configurations");
|
108
|
-
return
|
110
|
+
return 0;
|
109
111
|
}
|
110
112
|
<% else %>
|
111
113
|
<% raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}" %>
|
112
114
|
<% end %>
|
113
115
|
<% end %>
|
116
|
+
return 1;
|
117
|
+
}
|
@@ -47,10 +47,6 @@
|
|
47
47
|
#include "common/Utils/modp_b64.cpp" /* File is C compatible. */
|
48
48
|
|
49
49
|
|
50
|
-
#define HELPER_SERVER_MAX_SHUTDOWN_TIME 5
|
51
|
-
#define HELPER_SERVER_PASSWORD_SIZE 64
|
52
|
-
|
53
|
-
|
54
50
|
static int first_start = 1;
|
55
51
|
ngx_str_t pp_schema_string;
|
56
52
|
ngx_str_t pp_placeholder_upstream_address;
|
@@ -101,8 +97,10 @@ ignore_sigpipe() {
|
|
101
97
|
static char *
|
102
98
|
ngx_str_null_terminate(ngx_str_t *str) {
|
103
99
|
char *result = malloc(str->len + 1);
|
104
|
-
|
105
|
-
|
100
|
+
if (result != NULL) {
|
101
|
+
memcpy(result, str->data, str->len);
|
102
|
+
result[str->len] = '\0';
|
103
|
+
}
|
106
104
|
return result;
|
107
105
|
}
|
108
106
|
|
@@ -147,10 +145,10 @@ save_master_process_pid(ngx_cycle_t *cycle) {
|
|
147
145
|
}
|
148
146
|
|
149
147
|
/**
|
150
|
-
* This function is called after forking and just before exec()ing the
|
148
|
+
* This function is called after forking and just before exec()ing the watchdog.
|
151
149
|
*/
|
152
150
|
static void
|
153
|
-
|
151
|
+
starting_watchdog_after_fork(void *arg) {
|
154
152
|
ngx_cycle_t *cycle = (void *) arg;
|
155
153
|
char *log_filename;
|
156
154
|
FILE *log_file;
|
@@ -245,6 +243,7 @@ start_watchdog(ngx_cycle_t *cycle) {
|
|
245
243
|
ngx_core_conf_t *core_conf;
|
246
244
|
ngx_int_t ret, result;
|
247
245
|
ngx_uint_t i;
|
246
|
+
char *config_file = NULL;
|
248
247
|
ngx_str_t *prestart_uris;
|
249
248
|
char **prestart_uris_ary = NULL;
|
250
249
|
ngx_keyval_t *ctl = NULL;
|
@@ -257,24 +256,29 @@ start_watchdog(ngx_cycle_t *cycle) {
|
|
257
256
|
result = NGX_OK;
|
258
257
|
params = pp_variant_map_new();
|
259
258
|
passenger_root = ngx_str_null_terminate(&passenger_main_conf.root_dir);
|
259
|
+
if (passenger_root == NULL) {
|
260
|
+
goto error_enomem;
|
261
|
+
}
|
260
262
|
|
261
263
|
pp_app_type_detector_set_throttle_rate(pp_app_type_detector,
|
262
264
|
passenger_main_conf.stat_throttle_rate);
|
263
265
|
|
266
|
+
config_file = ngx_str_null_terminate(&cycle->conf_file);
|
267
|
+
if (config_file == NULL) {
|
268
|
+
goto error_enomem;
|
269
|
+
}
|
270
|
+
|
264
271
|
prestart_uris = (ngx_str_t *) passenger_main_conf.prestart_uris->elts;
|
265
272
|
prestart_uris_ary = calloc(sizeof(char *), passenger_main_conf.prestart_uris->nelts);
|
266
273
|
for (i = 0; i < passenger_main_conf.prestart_uris->nelts; i++) {
|
267
|
-
prestart_uris_ary[i] =
|
274
|
+
prestart_uris_ary[i] = ngx_str_null_terminate(&prestart_uris[i]);
|
268
275
|
if (prestart_uris_ary[i] == NULL) {
|
269
|
-
|
270
|
-
result = NGX_ERROR;
|
271
|
-
goto cleanup;
|
276
|
+
goto error_enomem;
|
272
277
|
}
|
273
|
-
memcpy(prestart_uris_ary[i], prestart_uris[i].data, prestart_uris[i].len);
|
274
|
-
prestart_uris_ary[i][prestart_uris[i].len] = '\0';
|
275
278
|
}
|
276
279
|
|
277
280
|
pp_variant_map_set_int (params, "web_server_pid", getpid());
|
281
|
+
pp_variant_map_set_strset (params, "web_server_config_files", (const char **) &config_file, 1);
|
278
282
|
pp_variant_map_set (params, "server_software", NGINX_VER, strlen(NGINX_VER));
|
279
283
|
pp_variant_map_set_bool (params, "multi_app", 1);
|
280
284
|
pp_variant_map_set_bool (params, "load_shell_envvars", 1);
|
@@ -325,7 +329,7 @@ start_watchdog(ngx_cycle_t *cycle) {
|
|
325
329
|
ret = pp_agents_starter_start(pp_agents_starter,
|
326
330
|
passenger_root,
|
327
331
|
params,
|
328
|
-
|
332
|
+
starting_watchdog_after_fork,
|
329
333
|
cycle,
|
330
334
|
&error_message);
|
331
335
|
if (!ret) {
|
@@ -354,29 +358,11 @@ start_watchdog(ngx_cycle_t *cycle) {
|
|
354
358
|
goto cleanup;
|
355
359
|
}
|
356
360
|
|
357
|
-
/* Create various other info files. */
|
358
|
-
last = ngx_snprintf(filename, sizeof(filename) - 1,
|
359
|
-
"%s/web_server.txt",
|
360
|
-
pp_agents_starter_get_instance_dir(pp_agents_starter, NULL));
|
361
|
-
*last = (u_char) '\0';
|
362
|
-
if (create_file(cycle, filename, (const u_char *) NGINX_VER, strlen(NGINX_VER)) != NGX_OK) {
|
363
|
-
result = NGX_ERROR;
|
364
|
-
goto cleanup;
|
365
|
-
}
|
366
|
-
|
367
|
-
last = ngx_snprintf(filename, sizeof(filename) - 1,
|
368
|
-
"%s/config_files.txt",
|
369
|
-
pp_agents_starter_get_instance_dir(pp_agents_starter, NULL));
|
370
|
-
*last = (u_char) '\0';
|
371
|
-
if (create_file(cycle, filename, cycle->conf_file.data, cycle->conf_file.len) != NGX_OK) {
|
372
|
-
result = NGX_ERROR;
|
373
|
-
goto cleanup;
|
374
|
-
}
|
375
|
-
|
376
361
|
cleanup:
|
377
362
|
pp_variant_map_free(params);
|
378
363
|
free(passenger_root);
|
379
364
|
free(error_message);
|
365
|
+
free(config_file);
|
380
366
|
if (prestart_uris_ary != NULL) {
|
381
367
|
for (i = 0; i < passenger_main_conf.prestart_uris->nelts; i++) {
|
382
368
|
free(prestart_uris_ary[i]);
|
@@ -389,13 +375,18 @@ cleanup:
|
|
389
375
|
}
|
390
376
|
|
391
377
|
return result;
|
378
|
+
|
379
|
+
error_enomem:
|
380
|
+
ngx_log_error(NGX_LOG_ALERT, cycle->log, ENOMEM, "Cannot allocate memory");
|
381
|
+
result = NGX_ERROR;
|
382
|
+
goto cleanup;
|
392
383
|
}
|
393
384
|
|
394
385
|
/**
|
395
|
-
* Shutdown the
|
386
|
+
* Shutdown the watchdog, if there's one running.
|
396
387
|
*/
|
397
388
|
static void
|
398
|
-
|
389
|
+
shutdown_watchdog() {
|
399
390
|
if (pp_agents_starter != NULL) {
|
400
391
|
pp_agents_starter_free(pp_agents_starter);
|
401
392
|
pp_agents_starter = NULL;
|
@@ -413,13 +404,13 @@ pre_config_init(ngx_conf_t *cf)
|
|
413
404
|
{
|
414
405
|
char *error_message;
|
415
406
|
|
416
|
-
|
407
|
+
shutdown_watchdog();
|
417
408
|
|
418
409
|
ngx_memzero(&passenger_main_conf, sizeof(passenger_main_conf_t));
|
419
410
|
pp_schema_string.data = (u_char *) "passenger:";
|
420
411
|
pp_schema_string.len = sizeof("passenger:") - 1;
|
421
|
-
pp_placeholder_upstream_address.data = (u_char *) "unix:/
|
422
|
-
pp_placeholder_upstream_address.len = sizeof("unix:/
|
412
|
+
pp_placeholder_upstream_address.data = (u_char *) "unix:/passenger_core";
|
413
|
+
pp_placeholder_upstream_address.len = sizeof("unix:/passenger_core") - 1;
|
423
414
|
pp_stat_cache = pp_cached_file_stat_new(1024);
|
424
415
|
pp_app_type_detector = pp_app_type_detector_new(DEFAULT_STAT_THROTTLE_RATE);
|
425
416
|
pp_agents_starter = pp_agents_starter_new(AS_NGINX, &error_message);
|
@@ -442,9 +433,9 @@ static ngx_int_t
|
|
442
433
|
init_module(ngx_cycle_t *cycle) {
|
443
434
|
if (passenger_main_conf.root_dir.len != 0 && !ngx_test_config) {
|
444
435
|
if (first_start) {
|
445
|
-
/* Ignore SIGPIPE now so that, if the
|
436
|
+
/* Ignore SIGPIPE now so that, if the watchdog fails to start,
|
446
437
|
* Nginx doesn't get killed by the default SIGPIPE handler upon
|
447
|
-
* writing the password to the
|
438
|
+
* writing the password to the watchdog.
|
448
439
|
*/
|
449
440
|
ignore_sigpipe();
|
450
441
|
first_start = 0;
|
@@ -486,7 +477,7 @@ init_worker_process(ngx_cycle_t *cycle) {
|
|
486
477
|
*/
|
487
478
|
static void
|
488
479
|
exit_master(ngx_cycle_t *cycle) {
|
489
|
-
|
480
|
+
shutdown_watchdog();
|
490
481
|
}
|
491
482
|
|
492
483
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2013 Phusion
|
3
|
+
# Copyright (c) 2013-2015 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -102,7 +102,7 @@ begin
|
|
102
102
|
# Example lines:
|
103
103
|
# ./test() [0x400b64]
|
104
104
|
# /lib/libc.so.6(__libc_start_main+0xfd) [0x7fcc0ad00c8d]
|
105
|
-
#
|
105
|
+
# Passenger core[0x4d2697]
|
106
106
|
if line =~ /(.*)\[(.*?)\]$/
|
107
107
|
# Split line into:
|
108
108
|
# subject: /lib/libc.so.6(__libc_start_main+0xfd)
|
data/lib/phusion_passenger.rb
CHANGED
@@ -30,7 +30,7 @@ module PhusionPassenger
|
|
30
30
|
|
31
31
|
PACKAGE_NAME = 'passenger'
|
32
32
|
# Run 'rake ext/common/Constants.h' after changing this number.
|
33
|
-
VERSION_STRING = '5.0.
|
33
|
+
VERSION_STRING = '5.0.11'
|
34
34
|
|
35
35
|
PREFERRED_NGINX_VERSION = '1.8.0'
|
36
36
|
NGINX_SHA256_CHECKSUM = '23cca1239990c818d8f6da118320c4979aadf5386deda691b1b7c2c96b9df3d5'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2014 Phusion
|
3
|
+
# Copyright (c) 2014-2015 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -84,12 +84,16 @@ module PhusionPassenger
|
|
84
84
|
private
|
85
85
|
def default_paths
|
86
86
|
if result = string_env("PASSENGER_INSTANCE_REGISTRY_DIR")
|
87
|
-
return result
|
87
|
+
return [result]
|
88
88
|
end
|
89
89
|
|
90
|
+
# On OSX, TMPDIR is set to a different value per-user. But Apache
|
91
|
+
# is launched through Launchctl and runs without TMPDIR (and thus
|
92
|
+
# uses the default /tmp).
|
93
|
+
#
|
90
94
|
# The RPM packages configure Apache and Nginx to use /var/run/passenger-instreg
|
91
95
|
# as the instance registry dir. See https://github.com/phusion/passenger/issues/1475
|
92
|
-
[string_env("TMPDIR")
|
96
|
+
[string_env("TMPDIR"), "/tmp", "/var/run/passenger-instreg"].compact
|
93
97
|
end
|
94
98
|
|
95
99
|
def string_env(name)
|
@@ -475,18 +475,18 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
|
|
475
475
|
Utils/IniFile.h
|
476
476
|
Utils/VariantMap.h
|
477
477
|
)
|
478
|
-
define_component '
|
479
|
-
:source => '
|
478
|
+
define_component 'AgentBase.o',
|
479
|
+
:source => 'agent/Base.cpp',
|
480
480
|
:category => :other,
|
481
481
|
:deps => %w(
|
482
|
-
|
482
|
+
agent/Base.h
|
483
483
|
Utils/VariantMap.h
|
484
484
|
)
|
485
|
-
define_component '
|
486
|
-
:source => '
|
487
|
-
:category => :
|
485
|
+
define_component 'agent/UstRouter/FilterSupport.o',
|
486
|
+
:source => 'agent/UstRouter/FilterSupport.cpp',
|
487
|
+
:category => :ust_router,
|
488
488
|
:deps => %w(
|
489
|
-
|
489
|
+
agent/UstRouter/FilterSupport.h
|
490
490
|
)
|
491
491
|
define_component 'MemoryKit/mbuf.o',
|
492
492
|
:source => 'MemoryKit/mbuf.cpp',
|
@@ -546,4 +546,4 @@ end
|
|
546
546
|
|
547
547
|
# Objects that must be linked into the Nginx binary.
|
548
548
|
NGINX_LIBS_SELECTOR = [:base, 'AgentsStarter.o', 'ApplicationPool2/AppTypes.o',
|
549
|
-
'Utils/CachedFileStat.o', '
|
549
|
+
'Utils/CachedFileStat.o', 'agent/UstRouter/FilterSupport.o']
|
@@ -167,7 +167,7 @@ module PhusionPassenger
|
|
167
167
|
end
|
168
168
|
puts
|
169
169
|
puts "## Notes for RVM users"
|
170
|
-
puts "Do you want to know which command to use for a different Ruby interpreter? 'rvm use' that Ruby interpreter, then re-run 'passenger-config
|
170
|
+
puts "Do you want to know which command to use for a different Ruby interpreter? 'rvm use' that Ruby interpreter, then re-run 'passenger-config about ruby-command'."
|
171
171
|
when "--rubyext-compat-id"
|
172
172
|
PhusionPassenger.require_passenger_lib 'platform_info/binary_compatibility'
|
173
173
|
puts PhusionPassenger::PlatformInfo.ruby_extension_binary_compatibility_id
|
@@ -37,7 +37,7 @@ module PhusionPassenger
|
|
37
37
|
include PhusionPassenger::Config::Utils
|
38
38
|
|
39
39
|
def self.create_default_options
|
40
|
-
{ :agent_name => "
|
40
|
+
{ :agent_name => "core_api" }
|
41
41
|
end
|
42
42
|
|
43
43
|
def run
|
@@ -93,8 +93,8 @@ module PhusionPassenger
|
|
93
93
|
opts.on("-a", "--agent NAME", String, "The name of the socket to send the command#{nl}" +
|
94
94
|
"to. This specifies which agent the request#{nl}" +
|
95
95
|
"is sent to. Choices: watchdog_api,#{nl}" +
|
96
|
-
"
|
97
|
-
"Default:
|
96
|
+
"core_api, ust_router_api.#{nl}" +
|
97
|
+
"Default: core_api") do |val|
|
98
98
|
options[:agent_name] = val
|
99
99
|
end
|
100
100
|
opts.on("-S", "--socket PATH", String, "Instead of inferring the socket path from#{nl}" +
|
@@ -32,6 +32,7 @@ PhusionPassenger.require_passenger_lib 'console_text_template'
|
|
32
32
|
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
33
33
|
PhusionPassenger.require_passenger_lib 'platform_info/depcheck'
|
34
34
|
PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
|
35
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpio'
|
35
36
|
|
36
37
|
module PhusionPassenger
|
37
38
|
module Config
|
@@ -123,29 +124,41 @@ module PhusionPassenger
|
|
123
124
|
end
|
124
125
|
|
125
126
|
def run_rake_task!(target)
|
126
|
-
total_lines = `#{rake} #{target} --dry-run STDERR_TO_STDOUT=1`.split("\n").size - 1
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
127
|
+
total_lines = `#{rake} #{target} --dry-run STDERR_TO_STDOUT=1 2>&1`.split("\n").size - 1
|
128
|
+
partial_backlog = ""
|
129
|
+
logfile = PhusionPassenger::Utils::TmpIO.new("passenger-install-log",
|
130
|
+
:mode => File::WRONLY, :unlink_immediately => false)
|
131
|
+
|
132
|
+
begin
|
133
|
+
command = "#{rake} #{target} --trace STDERR_TO_STDOUT=1 2>&1"
|
134
|
+
IO.popen(command, "rb") do |io|
|
135
|
+
progress = 1
|
136
|
+
while !io.eof?
|
137
|
+
line = io.readline
|
138
|
+
logfile.write(line)
|
139
|
+
yield(progress, total_lines)
|
140
|
+
if line =~ /^\*\* /
|
141
|
+
partial_backlog.replace("")
|
142
|
+
progress += 1
|
143
|
+
else
|
144
|
+
partial_backlog << line
|
145
|
+
end
|
140
146
|
end
|
141
147
|
end
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
148
|
+
if $?.exitstatus != 0
|
149
|
+
colors = @colors || PhusionPassenger::Utils::AnsiColors.new
|
150
|
+
stderr = @stderr || STDERR
|
151
|
+
stderr.puts
|
152
|
+
stderr.puts "#{colors.red}*** ERROR: a Rake command failed. You can find the full " +
|
153
|
+
"log in #{logfile.path}. Below, you can find the last few lines of the command's output.#{colors.reset}"
|
154
|
+
stderr.puts "#{colors.red}------------- Begin command output snippet -------------#{colors.reset}"
|
155
|
+
stderr.puts(partial_backlog)
|
156
|
+
stderr.puts "#{colors.red}------------- End command output snippet -------------#{colors.reset}"
|
157
|
+
stderr.puts "#{colors.red}The full log can be found in #{logfile.path}#{colors.reset}"
|
158
|
+
exit 1
|
159
|
+
end
|
160
|
+
ensure
|
161
|
+
logfile.close
|
149
162
|
end
|
150
163
|
end
|
151
164
|
|