41a6c3
diff --git a/server/scoreboard.c b/server/scoreboard.c
41a6c3
index a2e5daf..f989b99 100644
41a6c3
--- a/server/scoreboard.c
41a6c3
+++ b/server/scoreboard.c
41a6c3
@@ -138,8 +138,6 @@ AP_DECLARE(int) ap_calc_scoreboard_size(void)
41a6c3
     scoreboard_size += sizeof(process_score) * server_limit;
41a6c3
     scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
41a6c3
 
41a6c3
-    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
41a6c3
-
41a6c3
     return scoreboard_size;
41a6c3
 }
41a6c3
 
41a6c3
@@ -148,6 +146,11 @@ AP_DECLARE(void) ap_init_scoreboard(void *shared_score)
41a6c3
     char *more_storage;
41a6c3
     int i;
41a6c3
 
41a6c3
+    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
41a6c3
+    if (!shared_score) {
41a6c3
+        return;
41a6c3
+    }
41a6c3
+
41a6c3
     ap_calc_scoreboard_size();
41a6c3
     ap_scoreboard_image =
41a6c3
         ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
41a6c3
@@ -299,8 +302,6 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
41a6c3
     apr_status_t rv;
41a6c3
 #endif
41a6c3
 
41a6c3
-    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
41a6c3
-
41a6c3
     if (ap_scoreboard_image) {
41a6c3
         ap_scoreboard_image->global->restart_time = apr_time_now();
41a6c3
         memset(ap_scoreboard_image->parent, 0,
41a6c3
@@ -309,6 +310,7 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
41a6c3
             memset(ap_scoreboard_image->servers[i], 0,
41a6c3
                    sizeof(worker_score) * thread_limit);
41a6c3
         }
41a6c3
+        ap_init_scoreboard(NULL);
41a6c3
         return OK;
41a6c3
     }
41a6c3
 
41a6c3
diff --git a/server/core.c b/server/core.c
41a6c3
index c125015..eaa81a6 100644
41a6c3
--- a/server/core.c
41a6c3
+++ b/server/core.c
41a6c3
@@ -4843,6 +4843,11 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s)
41a6c3
     apr_random_after_fork(&proc;;
41a6c3
 }
41a6c3
 
41a6c3
+static void core_optional_fn_retrieve(void)
41a6c3
+{
41a6c3
+    ap_init_scoreboard(NULL);
41a6c3
+}
41a6c3
+
41a6c3
 AP_CORE_DECLARE(void) ap_random_parent_after_fork(void)
41a6c3
 {
41a6c3
     /*
41a6c3
@@ -5022,6 +5027,8 @@ static void register_hooks(apr_pool_t *p)
41a6c3
                                   APR_HOOK_REALLY_LAST);
41a6c3
     ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
41a6c3
     ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
41a6c3
+    ap_hook_optional_fn_retrieve(core_optional_fn_retrieve, NULL, NULL,
41a6c3
+                                 APR_HOOK_MIDDLE);
41a6c3
     
41a6c3
     /* register the core's insert_filter hook and register core-provided
41a6c3
      * filters