diff --git a/core/emperor.c b/core/emperor.c index 18d547fa..3745e6ff 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -1100,6 +1100,7 @@ static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) { struct uwsgi_string_list *uct; uwsgi_foreach(uct, uwsgi.vassals_templates_before) counter += 2; uwsgi_foreach(uct, uwsgi.vassals_includes_before) counter += 2; + uwsgi_foreach(uct, uwsgi.vassals_set) counter += 2; uwsgi_foreach(uct, uwsgi.vassals_templates) counter += 2; uwsgi_foreach(uct, uwsgi.vassals_includes) counter += 2; @@ -1122,6 +1123,12 @@ static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) { counter += 2; } + uwsgi_foreach (uct, uwsgi.vassals_set) { + vassal_argv[counter] = "--set"; + vassal_argv[counter + 1] = uct->value; + counter += 2; + } + char *colon = NULL; if (uwsgi.emperor_broodlord) { colon = strchr(n_ui->name, ':'); diff --git a/core/uwsgi.c b/core/uwsgi.c index 62e9d6e9..b1f5c4d8 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -222,7 +222,11 @@ static struct uwsgi_option uwsgi_base_options[] = { {"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}, + {"vassals-set", required_argument, 0, "automatically set the specified option (via --set) for every vassal", uwsgi_opt_add_string_list, &uwsgi.vassals_set, 0}, + {"vassal-set", required_argument, 0, "automatically set the specified option (via --set) for every vassal", uwsgi_opt_add_string_list, &uwsgi.vassals_set, 0}, + {"heartbeat", required_argument, 0, "announce healtness to the emperor", uwsgi_opt_set_int, &uwsgi.heartbeat, 0}, + {"auto-snapshot", optional_argument, 0, "automatically make workers snaphost after reload", uwsgi_opt_set_int, &uwsgi.auto_snapshot, UWSGI_OPT_LAZY}, {"reload-mercy", required_argument, 0, "set the maximum time (in seconds) we wait for workers and other processes to die during reload/shutdown", uwsgi_opt_set_int, &uwsgi.reload_mercy, 0}, {"worker-reload-mercy", required_argument, 0, "set the maximum time (in seconds) a worker can take to reload/shutdown (default is 60)", uwsgi_opt_set_int, &uwsgi.worker_reload_mercy, 0}, diff --git a/uwsgi.h b/uwsgi.h index 5b6bf2f9..ed17cccb 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1805,6 +1805,7 @@ struct uwsgi_server { struct uwsgi_string_list *vassals_includes; struct uwsgi_string_list *vassals_templates_before; struct uwsgi_string_list *vassals_includes_before; + struct uwsgi_string_list *vassals_set; // true if loyal to the emperor int loyal;