httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lazy <lazy...@gmail.com>
Subject [PATCH] mod_fcgid: add variable with handler pid
Date Sun, 16 Dec 2012 20:00:30 GMT
This proved to be useful during diagnosing various problems.

--- modules/fcgid/fcgid_bridge.c        (wersja 1422671)
+++ modules/fcgid/fcgid_bridge.c        (kopia robocza)
@@ -423,6 +423,7 @@
     fcgid_bucket_ctx *bucket_ctx;
     int i, j, cond_status;
     const char *location = NULL;
+    char *fcgid_pid;

     bucket_ctx = apr_pcalloc(r->pool, sizeof(*bucket_ctx));

@@ -481,6 +482,10 @@
                       cmd_conf->cmdline);
         return HTTP_SERVICE_UNAVAILABLE;
     }
+
+    fcgid_pid=apr_psprintf(r->pool, "%" APR_PID_T_FMT ,
bucket_ctx->procnode->proc_id.pid);
+    if(fcgid_pid)
+       apr_table_set(r->notes, "mod_fcgid.hpid", fcgid_pid);
     bucket_ctx->active_time = bucket_ctx->procnode->last_active_time =
         apr_time_now();
     bucket_ctx->procnode->diewhy = FCGID_DIE_KILLSELF;
Index: docs/manual/mod/mod_fcgid.xml
===================================================================
--- docs/manual/mod/mod_fcgid.xml       (wersja 1422671)
+++ docs/manual/mod/mod_fcgid.xml       (kopia robocza)
@@ -416,6 +416,10 @@

     <p>Information about each process will be displayed in the
     <module>mod_status</module> server-status page.</p>
+    <p>Information about pid of the handler processing the request
+    is available in <code>mod_fcgid.hpid</code> variable.<br/>
+    It can be accessed using <module>mod_log_config</module>
+    <code>%{<var>mod_fcgid.hpid</var>}n</code> syntax.</p>
   </section>

  <directivesynopsis>
Index: docs/manual/mod/mod_fcgid.html.en
===================================================================
--- docs/manual/mod/mod_fcgid.html.en   (wersja 1422671)
+++ docs/manual/mod/mod_fcgid.html.en   (kopia robocza)
@@ -8,11 +8,14 @@
 <title>mod_fcgid - Apache HTTP Server</title>
 <link href="../style/css/manual.css" rel="stylesheet" media="all"
type="text/css" title="Main stylesheet" />
 <link href="../style/css/manual-loose-100pc.css" rel="alternate
stylesheet" media="all" type="text/css" title="No Sidebar - Default
font size" />
-<link href="../style/css/manual-print.css" rel="stylesheet"
media="print" type="text/css" />
+<link href="../style/css/manual-print.css" rel="stylesheet"
media="print" type="text/css" /><link rel="stylesheet" type="text/css"
href="../style/css/prettify.css" />
+<script src="../style/scripts/prettify.js" type="text/javascript">
+</script>
+
 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
 <body>
 <div id="page-header">
-<p class="menu"><a href="../mod/">Modules</a> | <a
href="../mod/directives.html">Directives</a> | <a
href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a
href="../sitemap.html">Sitemap</a></p>
+<p class="menu"><a href="../mod/">Modules</a> | <a
href="../mod/directives.html">Directives</a> | <a
href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a
href="../glossary.html">Glossary</a> | <a
href="../sitemap.html">Sitemap</a></p>
 <p class="apache">Apache HTTP Server Version 2.4</p>
 <img alt="" src="../images/feather.gif" /></div>
 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-"
src="../images/left.gif" /></a></div>
@@ -109,7 +112,7 @@
 <li><a href="../howto/cgi.html">Dynamic Content With CGI</a></li>
 <li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li>
 <li><code class="module"><a
href="../mod/mod_cgid.html">mod_cgid</a></code></li>
-</ul></div>
+</ul><ul class="seealso"><li><a
href="#comments_section">Comments</a></li></ul></div>
 <div class="top"><a href="#page-header"><img alt="top"
src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="upgrade" id="upgrade">Upgrade Notes</a></h2>
@@ -460,6 +463,10 @@

     <p>Information about each process will be displayed in the
     <code class="module"><a
href="../mod/mod_status.html">mod_status</a></code> server-status
page.</p>
+    <p>Information about pid of the handler processing the request
+    is available in <code>mod_fcgid.hpid</code> variable.<br />
+    It can be accessed using <code class="module"><a
href="../mod/mod_log_config.html">mod_log_config</a></code>
+    <code>%{<var>mod_fcgid.hpid</var>}n</code> syntax.</p>
   </div>
 <div class="top"><a href="#page-header"><img alt="top"
src="../images/up.gif" /></a></div>
 <div class="directive-section"><h2><a name="FcgidAccessChecker"
id="FcgidAccessChecker">FcgidAccessChecker</a> <a
name="fcgidaccesschecker" id="fcgidaccessch
ecker">Directive</a></h2>
@@ -1291,7 +1298,28 @@
 </div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a
href="../en/mod/mod_fcgid.html" title="English">&nbsp;en&nbsp;</a></p>
-</div><div id="footer">
+</div><div class="top"><a href="#page-header"><img
src="../images/up.gif" alt="top" /></a></div><div
class="section"><h2><a id="comments_section"
name="comments_section">Comments</a></h2><div
class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A
section. Comments placed here should be pointed towards suggestions on
improving the documentation or server, and may be removed again by our
moderators if they are either implemented or considered
invalid/off-topic. Questions on how to manage the Apache HTTP Server
should be directed at either our IRC channel, #httpd, on Freenode, or
sent to our <a href="http://httpd.apache.org/lists.html">mailing
lists</a>.</div>
+<script type="text/javascript"><!--//--><![CDATA[//><!--
+var comments_shortname = 'httpd';
+var comments_identifier =
'http://httpd.apache.org/docs/trunk/mod/mod_fcgid.html';
+(function(w, d) {
+    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
+        d.write('<div id="comments_thread"><\/div>');
+        var s = d.createElement('script');
+        s.type = 'text/javascript';
+        s.async = true;
+        s.src = 'https://comments.apache.org/show_comments.lua?site='
+ comments_shortname + '&page=' + comments_identifier;
+        (d.getElementsByTagName('head')[0] ||
d.getElementsByTagName('body')[0]).appendChild(s);
+    }
+    else {
+        d.write('<div id="comments_thread">Comments are disabled for
this page at the moment.<\/div>');
+    }
+})(window, document);
+//--><!]]></script></div><div id="footer">
 <p class="apache">Copyright 2012 The Apache Software Foundation.<br
/>Licensed under the <a
href="http://www.apache.org/licenses/LICENSE-2.0">Apache License,
Version 2.0</a>.</p>
-<p class="menu"><a href="../mod/">Modules</a> | <a
href="../mod/directives.html">Directives</a> | <a
href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a
href="../sitemap.html">Sitemap</a></p></div>
+<p class="menu"><a href="../mod/">Modules</a> | <a
href="../mod/directives.html">Directives</a> | <a
href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a
href="../glossary.html">Glossary</a> | <a
href="../sitemap.html">Sitemap</a></p></div><script
type="text/javascript"><!--//--><![CDATA[//><!--
+if (typeof(prettyPrint) !== 'undefined') {
+    prettyPrint();
+}
+//--><!]]></script>
 </body></html>


Regards,

Michał Grzędzicki

Mime
View raw message