diff --git a/core/mule.c b/core/mule.c index 11fba3b7..d2aa8498 100644 --- a/core/mule.c +++ b/core/mule.c @@ -77,6 +77,7 @@ void uwsgi_mule(int id) { } } + uwsgi_hooks_run(uwsgi.hook_as_mule, "as-mule", 1); uwsgi_mule_run(); } diff --git a/core/uwsgi.c b/core/uwsgi.c index a80de4e3..23c57956 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -378,8 +378,10 @@ static struct uwsgi_option uwsgi_base_options[] = { {"hook-accepting-once", required_argument, 0, "run the specified hook after each worker enter the accepting phase (once per-instance)", uwsgi_opt_add_string_list, &uwsgi.hook_accepting_once, 0}, {"hook-accepting1-once", required_argument, 0, "run the specified hook after the first worker enters the accepting phase (once per instance)", uwsgi_opt_add_string_list, &uwsgi.hook_accepting1_once, 0}, - {"hook-as-vassal", required_argument, 0, "run the specified command before exec()ing the vassal", uwsgi_opt_add_string_list, &uwsgi.hook_as_vassal, 0}, - {"hook-as-emperor", required_argument, 0, "run the specified command in the emperor after the vassal has been started", uwsgi_opt_add_string_list, &uwsgi.hook_as_emperor, 0}, + {"hook-as-vassal", required_argument, 0, "run the specified hook before exec()ing the vassal", uwsgi_opt_add_string_list, &uwsgi.hook_as_vassal, 0}, + {"hook-as-emperor", required_argument, 0, "run the specified hook in the emperor after the vassal has been started", uwsgi_opt_add_string_list, &uwsgi.hook_as_emperor, 0}, + + {"hook-as-mule", required_argument, 0, "run the specified hook in each mule", uwsgi_opt_add_string_list, &uwsgi.hook_as_mule, 0}, {"exec-asap", required_argument, 0, "run the specified command as soon as possible", uwsgi_opt_add_string_list, &uwsgi.exec_asap, 0}, {"exec-pre-jail", required_argument, 0, "run the specified command before jailing", uwsgi_opt_add_string_list, &uwsgi.exec_pre_jail, 0}, diff --git a/uwsgi.h b/uwsgi.h index 99862804..38478aeb 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1999,6 +1999,7 @@ struct uwsgi_server { struct uwsgi_string_list *hook_as_vassal; struct uwsgi_string_list *hook_as_emperor; + struct uwsgi_string_list *hook_as_mule; struct uwsgi_string_list *exec_asap;