This commit is contained in:
Unbit
2013-09-17 14:16:41 +02:00
parent 20844ebfca
commit 469fd697cb
3 changed files with 18 additions and 1 deletions
+15
View File
@@ -1031,6 +1031,12 @@ static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) {
uct = uct->next;
}
uct = uwsgi.vassals_includes;
while (uct) {
counter += 2;
uct = uct->next;
}
char **vassal_argv = uwsgi_malloc(sizeof(char *) * counter);
// set args
vassal_argv[0] = uwsgi.binary_path;
@@ -1093,6 +1099,15 @@ static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) {
counter += 2;
uct = uct->next;
}
uct = uwsgi.vassals_includes;
while (uct) {
vassal_argv[counter] = "--include";
vassal_argv[counter + 1] = uct->value;
counter += 2;
uct = uct->next;
}
vassal_argv[counter] = NULL;
// disable stdin OR map it to the "on demand" socket
+2 -1
View File
@@ -199,7 +199,8 @@ static struct uwsgi_option uwsgi_base_options[] = {
#endif
{"imperial-monitor-list", no_argument, 0, "list enabled imperial monitors", uwsgi_opt_true, &uwsgi.imperial_monitor_list, 0},
{"imperial-monitors-list", no_argument, 0, "list enabled imperial monitors", uwsgi_opt_true, &uwsgi.imperial_monitor_list, 0},
{"vassals-inherit", required_argument, 0, "add config templates to vassals config", uwsgi_opt_add_string_list, &uwsgi.vassals_templates, 0},
{"vassals-inherit", required_argument, 0, "add config templates to vassals config (uses --inherit)", uwsgi_opt_add_string_list, &uwsgi.vassals_templates, 0},
{"vassals-include", required_argument, 0, "inclue config templates to vassals config (uses --include instead of --inherit)", uwsgi_opt_add_string_list, &uwsgi.vassals_includes, 0},
{"vassals-start-hook", required_argument, 0, "run the specified command before each vassal starts", uwsgi_opt_set_str, &uwsgi.vassals_start_hook, 0},
{"vassals-stop-hook", required_argument, 0, "run the specified command after vassal's death", uwsgi_opt_set_str, &uwsgi.vassals_stop_hook, 0},
{"vassal-sos-backlog", required_argument, 0, "ask emperor for sos if backlog queue has more items than the value specified", uwsgi_opt_set_int, &uwsgi.vassal_sos_backlog, 0},
+1
View File
@@ -1774,6 +1774,7 @@ struct uwsgi_server {
char *emperor_stats;
int emperor_stats_fd;
struct uwsgi_string_list *vassals_templates;
struct uwsgi_string_list *vassals_includes;
// true if loyal to the emperor
int loyal;