diff --git a/src/haproxy.c b/src/haproxy.c index a379cbcae..a6b8dc3ad 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -799,7 +799,15 @@ static void mworker_reexec_waitmode() /* reload haproxy and emit a warning */ void mworker_reload() { + struct mworker_proc *child; + ha_notice("Reloading HAProxy\n"); + + /* increment the number of reloads */ + list_for_each_entry(child, &proc_list, list) { + child->reloads++; + } + mworker_reexec(); } diff --git a/src/mworker.c b/src/mworker.c index 68aea603f..fe1770618 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -174,8 +174,8 @@ int mworker_env_to_proc_list() } else if (strncmp(subtoken, "pid=", 4) == 0) { child->pid = atoi(subtoken+4); } else if (strncmp(subtoken, "reloads=", 8) == 0) { - /* we reloaded this process once more */ - child->reloads = atoi(subtoken+8) + 1; + /* we only increment the number of asked reload */ + child->reloads = atoi(subtoken+8); } else if (strncmp(subtoken, "timestamp=", 10) == 0) { child->timestamp = atoi(subtoken+10); } else if (strncmp(subtoken, "id=", 3) == 0) {