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