summaryrefslogtreecommitdiffstats
path: root/modules/arch
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2018-09-11 14:53:30 +0200
committerJoe Orton <jorton@apache.org>2018-09-11 14:53:30 +0200
commit64552862ed6569e37be5356960d54e2948aeb431 (patch)
tree98af65b9c4cb2fc082ec6a46900c08f0d99d63f8 /modules/arch
parentFollow up to r1840149: core input filter pending data. (diff)
downloadapache2-64552862ed6569e37be5356960d54e2948aeb431.tar.xz
apache2-64552862ed6569e37be5356960d54e2948aeb431.zip
* modules/arch/unix/mod_systemd.c (systemd_post_config): Fix systemd
service getting stuck reloading if "ExtendedStatus off" is configured; regression in r1802251. PR: 62697 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1840554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/arch')
-rw-r--r--modules/arch/unix/mod_systemd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/arch/unix/mod_systemd.c b/modules/arch/unix/mod_systemd.c
index 72d04bddc3..1c84e9767c 100644
--- a/modules/arch/unix/mod_systemd.c
+++ b/modules/arch/unix/mod_systemd.c
@@ -49,6 +49,21 @@ static int systemd_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
return OK;
}
+/* Report the service is ready in post_config, which could be during
+ * startup or after a reload. The server could still hit a fatal
+ * startup error after this point during ap_run_mpm(), so this is
+ * perhaps too early, but by post_config listen() has been called on
+ * the TCP ports so new connections will not be rejected. There will
+ * always be a possible async failure event simultaneous to the
+ * service reporting "ready", so this should be good enough. */
+static int systemd_post_config(apr_pool_t *p, apr_pool_t *plog,
+ apr_pool_t *ptemp, server_rec *main_server)
+{
+ sd_notify(0, "READY=1\n"
+ "STATUS=Configuration loaded.\n");
+ return OK;
+}
+
static int systemd_pre_mpm(apr_pool_t *p, ap_scoreboard_e sb_type)
{
int rv;
@@ -125,6 +140,8 @@ static void systemd_register_hooks(apr_pool_t *p)
{
/* Enable ap_extended_status. */
ap_hook_pre_config(systemd_pre_config, NULL, NULL, APR_HOOK_LAST);
+ /* Signal service is ready. */
+ ap_hook_post_config(systemd_post_config, NULL, NULL, APR_HOOK_REALLY_LAST);
/* We know the PID in this hook ... */
ap_hook_pre_mpm(systemd_pre_mpm, NULL, NULL, APR_HOOK_LAST);
/* Used to update httpd's status line using sd_notifyf */