Blame SOURCES/httpd-2.4.34-r1840554.patch

ad4e62
diff --git a/modules/arch/unix/mod_systemd.c b/modules/arch/unix/mod_systemd.c
ad4e62
index 9359d38..6d0cb3b 100644
ad4e62
--- a/modules/arch/unix/mod_systemd.c
ad4e62
+++ b/modules/arch/unix/mod_systemd.c
ad4e62
@@ -49,6 +49,21 @@ static int systemd_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
ad4e62
     return OK;
ad4e62
 }
ad4e62
 
ad4e62
+/* Report the service is ready in post_config, which could be during
ad4e62
+ * startup or after a reload.  The server could still hit a fatal
ad4e62
+ * startup error after this point during ap_run_mpm(), so this is
ad4e62
+ * perhaps too early, but by post_config listen() has been called on
ad4e62
+ * the TCP ports so new connections will not be rejected.  There will
ad4e62
+ * always be a possible async failure event simultaneous to the
ad4e62
+ * service reporting "ready", so this should be good enough. */
ad4e62
+static int systemd_post_config_last(apr_pool_t *p, apr_pool_t *plog,
ad4e62
+                               apr_pool_t *ptemp, server_rec *main_server)
ad4e62
+{
ad4e62
+    sd_notify(0, "READY=1\n"
ad4e62
+              "STATUS=Configuration loaded.\n");
ad4e62
+    return OK;
ad4e62
+}
ad4e62
+
ad4e62
 static int systemd_pre_mpm(apr_pool_t *p, ap_scoreboard_e sb_type)
ad4e62
 {
ad4e62
     int rv;
ad4e62
@@ -125,6 +140,8 @@ static void systemd_register_hooks(apr_pool_t *p)
ad4e62
 {
ad4e62
     /* Enable ap_extended_status. */
ad4e62
     ap_hook_pre_config(systemd_pre_config, NULL, NULL, APR_HOOK_LAST);
ad4e62
+    /* Signal service is ready. */
ad4e62
+    ap_hook_post_config(systemd_post_config_last, NULL, NULL, APR_HOOK_REALLY_LAST);
ad4e62
     /* We know the PID in this hook ... */
ad4e62
     ap_hook_pre_mpm(systemd_pre_mpm, NULL, NULL, APR_HOOK_LAST);
ad4e62
     /* Used to update httpd's status line using sd_notifyf */