httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poir...@apache.org
Subject svn commit: r910684 - in /httpd/httpd/trunk: CHANGES include/ap_mmn.h include/http_log.h server/log.c server/mpm/event/event.c server/mpm/netware/mpm_netware.c server/mpm/prefork/prefork.c server/mpm/winnt/mpm_winnt.c server/mpm/worker/worker.c
Date Tue, 16 Feb 2010 20:50:11 GMT
Author: poirier
Date: Tue Feb 16 20:50:10 2010
New Revision: 910684

URL: http://svn.apache.org/viewvc?rev=910684&view=rev
Log:
Log command line on startup, so there's a record of command line
arguments like -f.  Suggested by Shaya Potter.  [Dan Poirier]
PR: 48752

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/http_log.h
    httpd/httpd/trunk/server/log.c
    httpd/httpd/trunk/server/mpm/event/event.c
    httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
    httpd/httpd/trunk/server/mpm/worker/worker.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Feb 16 20:50:10 2010
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.7
 
+  *) Log command line on startup, so there's a record of command line
+     arguments like -f.
+     PR 48752.  [Dan Poirier]
+
   *) Introduce mod_reflector, a handler capable of reflecting POSTed
      request bodies back within the response through the output filter
      stack. Can be used to turn an output filter into a web service.

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Tue Feb 16 20:50:10 2010
@@ -216,6 +216,7 @@
  * 20091230.4 (2.3.6-dev)  export ap_process_request_after_handler() for mod_serf
  * 20100208.0 (2.3.6-dev)  ap_socache_provider_t API changes to store and iterate
  * 20100208.1 (2.3.6-dev)  Added forward member to proxy_conn_rec
+ * 20100215.0 (2.3.7-dev)  Added ap_log_command_line().
  *
  */
 

Modified: httpd/httpd/trunk/include/http_log.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_log.h?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_log.h (original)
+++ httpd/httpd/trunk/include/http_log.h Tue Feb 16 20:50:10 2010
@@ -250,6 +250,14 @@
 AP_DECLARE(void) ap_error_log2stderr(server_rec *s);
 
 /**
+ * Log the command line used to start the server.
+ * @param p The pool to use for logging
+ * @param s The server_rec whose process's command line we want to log.
+ * The command line is logged to that server's error log.
+ */
+AP_DECLARE(void) ap_log_command_line(apr_pool_t *p, server_rec *s);
+
+/**
  * Log the current pid of the parent process
  * @param p The pool to use for logging
  * @param fname The name of the file to log to

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Tue Feb 16 20:50:10 2010
@@ -784,6 +784,33 @@
     va_end(args);
 }
 
+AP_DECLARE(void) ap_log_command_line(apr_pool_t *plog, server_rec *s)
+{
+    int i;
+    process_rec *process = s->process;
+    char *result;
+    int len_needed = 0;
+    
+    /* Piece together the command line from the pieces
+     * in process->argv, with spaces in between.
+     */
+    for (i = 0; i < process->argc; i++) {
+        len_needed += strlen(process->argv[i]) + 1;
+    }
+
+    result = (char *) apr_palloc(plog, len_needed);
+    *result = '\0';
+
+    for (i = 0; i < process->argc; i++) {
+        strcat(result, process->argv[i]);
+        if ((i+1)< process->argc) {
+            strcat(result, " ");
+        }
+    }
+    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
+                 "Command line: '%s'", result);
+}
+
 AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
 {
     apr_file_t *pid_file = NULL;

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Feb 16 20:50:10 2010
@@ -2239,6 +2239,7 @@
                  ap_get_server_description());
     ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
                  "Server built: %s", ap_get_server_built());
+    ap_log_command_line(plog, s);
 
     restart_pending = shutdown_pending = 0;
     mpm_state = AP_MPMQ_RUNNING;

Modified: httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/netware/mpm_netware.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/netware/mpm_netware.c (original)
+++ httpd/httpd/trunk/server/mpm/netware/mpm_netware.c Tue Feb 16 20:50:10 2010
@@ -922,6 +922,7 @@
             ap_get_server_description());
     ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
             "Server built: %s", ap_get_server_built());
+    ap_log_command_line(plog, s);
     show_server_data();
 
     mpm_state = AP_MPMQ_RUNNING;

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Tue Feb 16 20:50:10 2010
@@ -971,6 +971,7 @@
                 ap_get_server_description());
     ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
                 "Server built: %s", ap_get_server_built());
+    ap_log_command_line(plog, s);
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
                 "Accept mutex: %s (default: %s)",
                 apr_proc_mutex_name(accept_mutex),

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Tue Feb 16 20:50:10 2010
@@ -1696,6 +1696,7 @@
                      ap_get_server_description());
         ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
                      "Server built: %s", ap_get_server_built());
+        ap_log_command_line(plog, s);
 
         restart = master_main(ap_server_conf, shutdown_event, restart_event);
 

Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=910684&r1=910683&r2=910684&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Tue Feb 16 20:50:10 2010
@@ -1758,6 +1758,7 @@
                 ap_get_server_description());
     ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
                 "Server built: %s", ap_get_server_built());
+    ap_log_command_line(plog, s);
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
                 "Accept mutex: %s (default: %s)",
                 apr_proc_mutex_name(accept_mutex),



Mime
View raw message