]> granicus.if.org Git - apache/commitdiff
Setup the server start time correctly. This also gets the server uptime
authorRyan Bloom <rbb@apache.org>
Tue, 6 Feb 2001 20:41:07 +0000 (20:41 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 6 Feb 2001 20:41:07 +0000 (20:41 +0000)
to be reported correctly.  I have also moved this code into a common
location, so that individual MPMs do not need to worry about setting up
the start time.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87994 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/beos/beos.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c
server/mpm/winnt/mpm_winnt.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index dd2b5bafc073f339179d44e910b5a4d1beef2651..723a002acaba7430479951e95cda7d51c255c36a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0b1
 
+  *) Make the server status page show the correct restart time, and
+     thus the proper uptime. [Ryan Bloom]
+
   *) Move the CGI creation logic from mod_include to mod_cgi(d).  This
      should reduce the amount of duplicate code that is required to
      create CGI processes.
index ff7361bc93eb3c73ae1e6af2a91f102b46c11edc..722a0af3b3abb028985a77e9b611e70bc0176741 100644 (file)
@@ -97,7 +97,6 @@ static int ap_threads_to_start=0;
 static int min_spare_threads=0;
 static int max_spare_threads=0;
 static int ap_thread_limit=0;
-static apr_time_t ap_restart_time=0;
 AP_DECLARE_DATA int ap_extended_status = 0;
 static int num_listening_sockets = 0; /* set by open_listeners in ap_mpm_run */
 static apr_socket_t ** listening_sockets;
@@ -797,10 +796,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
                    "SIGHUP received.  Attempting to restart");
     }
     
-    if (!is_graceful) {
-        ap_restart_time = apr_now();
-    }
-
     /* just before we go, tidy up the locks we've created to prevent a 
      * potential leak of semaphores... */
     apr_destroy_lock(worker_thread_count_mutex);
index c758bd1feff2630c210fc83d7a9e87491076f8da..db5220e00b09abaadb91cc89bbc2214d396198f0 100644 (file)
@@ -91,7 +91,6 @@ static int ap_daemons_to_start=0;
 static int min_spare_threads=0;
 static int max_spare_threads=0;
 static int ap_daemons_limit=0;
-static apr_time_t ap_restart_time=0;
 AP_DECLARE_DATA int ap_extended_status = 0;
 static int workers_may_exit = 0;
 static int requests_this_child;
@@ -809,9 +808,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, errno, ap_server_conf,
                    "SIGHUP received.  Attempting to restart");
     }
-    if (!is_graceful) {
-        ap_restart_time = apr_now();
-    }
     delete_port(port_of_death);
     return 0;
 }
index 5f707e46f41056893c28550d8bc17862c413cb18..fabdf37274dbf96c07ed94379b4f90f793b468a7 100644 (file)
@@ -1148,9 +1148,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
                    "SIGHUP received.  Attempting to restart");
     }
-    if (!is_graceful) {
-        ap_restart_time = apr_now();
-    }
     return 0;
 }
 
index 172585b88c282af48acc36b4e75fa8bf399ee1b2..00a13a83dbc7a3fc0f5dbd360158e7b9deeaae7d 100644 (file)
@@ -1280,10 +1280,6 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
                    "SIGHUP received.  Attempting to restart");
     }
 
-    if (!is_graceful) {
-       ap_restart_time = apr_now();
-    }
-
     return 0;
 }
 
index 9773fb2c2adbdd3b840c2ca84d7651d3def02be0..96169d0d670418f0711c17daba532e15d5e78354 100644 (file)
@@ -1240,7 +1240,6 @@ static void child_main()
     /* Set up the scoreboard. The scoreboard in this MPM only applies to the
      * child process and is not shared across processes
      */
-    ap_restart_time = apr_now();
     ap_create_scoreboard(pconf, SB_NOT_SHARED);
 
     /* This is the child process or we are running in single process
index 17ab9e2d200441f135842dd293893ece9ba9c236..2d4353b884903e7e7b707911d1ec6a8025f6f962 100644 (file)
@@ -185,6 +185,7 @@ AP_DECLARE(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
     }
     memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE);
     ap_scoreboard_image->global.running_generation = running_gen;
+    ap_restart_time = apr_now();
     apr_register_cleanup(p, NULL, ap_cleanup_scoreboard, apr_null_cleanup);
 }