From: Ryan Bloom Date: Tue, 6 Feb 2001 20:41:07 +0000 (+0000) Subject: Setup the server start time correctly. This also gets the server uptime X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f7360ca951e8f0db97b57c4096b22c113e413fc;p=apache Setup the server start time correctly. This also gets the server uptime 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 --- diff --git a/CHANGES b/CHANGES index dd2b5bafc0..723a002aca 100644 --- 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. diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c index ff7361bc93..722a0af3b3 100644 --- a/server/mpm/beos/beos.c +++ b/server/mpm/beos/beos.c @@ -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); diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c index c758bd1fef..db5220e00b 100644 --- a/server/mpm/mpmt_beos/mpmt_beos.c +++ b/server/mpm/mpmt_beos/mpmt_beos.c @@ -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; } diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 5f707e46f4..fabdf37274 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -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; } diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 172585b88c..00a13a83db 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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; } diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 9773fb2c2a..96169d0d67 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -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 diff --git a/server/scoreboard.c b/server/scoreboard.c index 17ab9e2d20..2d4353b884 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -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); }