Skip to content

Commit

Permalink
Add broker ready message.
Browse files Browse the repository at this point in the history
Before this commit there was no good way to detect that the
Mosquitto broker was done with its startup phase on systems
without systemd.

On such systems it was tricky to e.g. start the broker from
a test where ports are dynamically assigned and one have to
deal with potential port conflicts.  Without a way to know
that the broker is done with its startup phase, there was no
way to know if the broker was able to acquire the port (for
both IPv4 and IPv6) without waiting for some unknown period
of time (when many tests are run in parallel a single process
might be starved for resources).

With this new broker ready message it is easy for the parent
process to monitor the broker output and figure out when the
port was successfully acquired.

Signed-off-by: Sigmund Vik <[email protected]>
  • Loading branch information
SigmundVik authored and ralight committed Jul 10, 2020
1 parent c896422 commit 20972a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ int main(int argc, char *argv[])
}
#endif

log__printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s running", VERSION);
#ifdef WITH_SYSTEMD
sd_notify(0, "READY=1");
#endif
Expand Down

0 comments on commit 20972a2

Please sign in to comment.