git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] gitweb: Add support for running gitweb as FastCGI script

From
Peter Vereshagin <peter@vereshagin.org>
Date
May 10, 2010, 07:13 UTC
Message-ID
<20100510071340.GA3382@screwed.box>
In-Reply-To
<201005092018.54580.jnareb@gmail.com>

Hey Jakub don't wanna cause you pain but the big boys feel no sorrow! 2010/05/09 20:18:52 +0200 Jakub Narebski <jnareb@gmail.com> => To Peter Vereshagin :

Great! I was just about to ask on caching, etc. What a complex history on all of that, will be on those tracks after some of my whiles. ;-)

JN> What are required changes to gitweb to use FCGI::Spawn to run gitweb as JN> a FastCGI script? Alternatively, how the wrapper script for gitweb JN> (gitweb.fcgi) to be run as FastCGI should look like to use FCGI::Spawn?

By far it's only an exit() of the what I use (1.6.0.6):

--- /usr/local/share/examples/git/gitweb/gitweb.cgi 2010-02-25 13:49:30.068287112 +0300 +++ www/gitweb.cgi 2010-03-13 14:28:45.326244103 +0300

@@ -933,7 +933,7 @@
        die_error(400, "Project needed");
 }
 $actions{$action}->();
-exit;
+#      exit;
 
 ## ======================================================================
 ## action links
@@ -3371,7 +3371,7 @@
 </div>
 EOF
        git_footer_html();
-       exit;
+#              exit;
 }
 
 ## ----------------------------------------------------------------------


but it's probably even not necessary with -e parameter:
http://search.cpan.org/~veresc/FCGI-Spawn-0.16.1/fcgi_spawn#Command_line_options
which is definitely required for bugzilla, the worst boy in that sandbox. The
parameter does just this: 
===
my $cref = sub {
  if( 'FCGI::ProcManager' eq scalar caller ){
    CORE::exit @_;
  } else {
    no warnings;
    last CALLED_OUT;
  }
};
*CORE::GLOBAL::exit = $cref;
*CORE::GLOBAL::exit;
===
so this requires configuration 
( $PREFIX/etc/fcgi_spawn/preload_nonprepared_01.pl, in my case ) for fcgi_spawn
daemon like this:
===
  $spawn->{ callout } =  sub{ do shift;
  CALLED_OUT: 
  };
===
all of that is not needed without exit() in gitweb, now.

I didn't mean FCGI::PM is a problem by itself. The standalone gitweb daemon is
great thing for those who need such a choice. FCGI::Spawn is just for some
different task: to put several ( wish to say: any CGI app ) applications inside
the same fork()ed processes. It should be just obviously documented for a user
as a dependency for implementation of a gitweb fastcgi daemon. Although I'm not
sure if the FCGI::PM package should be a dependency for git package for any OS:
for those modules use()d in eval() my guess is: particular user's choice to be
offered.

So FCGI::PM usage I think makes a flavor taste for any daemon and thus should
be explicit. YMMV for those uninvolved in daemonizing, of course. ;-)

Is it probable that gitweb doesn't take any POSTs requests? The main trick
around FCGI::Spawn is the need to patch the CGI.pm but if that is the case...
I'd try to redefine the STDIN to /dev/null or zero so FCGI.Spawn.CGI.pm.patch
should be unnecessary for one who only wants to run the gitweb in FCGI::Spawn.
If switch to FCGI.pm will be way complicated to me.

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB  12F8 0CE1 4AAC A0E2 6627)
-- 
http://vereshagin.org
Previous: Jakub NarebskiNext: Jakub Narebski
Message 11 of 30 in “gitweb: Add support for running gitweb as FastCGI script”
  1. 0/2 gitweb: Add support for running gitweb as FastCGI scriptJakub Narebski, May 7, 2010
  2. 1/2 gitweb: Put all per-connection code in run() subroutineJakub Narebski, May 7, 2010
  3. 2/2 gitweb: Add support for FastCGI, using CGI::FastJakub Narebski, May 7, 2010
  4. 2/2 gitweb: Add support for FastCGI, using CGI::FastJakub Narebski, May 8, 2010
  5. Jakub NarebskiMay 8, 2010
  6. Eric WongMay 9, 2010
  7. Ævar Arnfjörð BjarmasonMay 9, 2010
  8. Jakub NarebskiMay 9, 2010
  9. Peter VereshaginMay 9, 2010
  10. Jakub NarebskiMay 9, 2010
  11. Peter VereshaginMay 10, 2010
  12. Jakub NarebskiMay 10, 2010
  13. Peter VereshaginMay 11, 2010
  14. Petr BaudisMay 11, 2010
  15. Jakub NarebskiMay 11, 2010
  16. Peter VereshaginMay 11, 2010
  17. Jakub NarebskiMay 11, 2010
  18. Peter VereshaginMay 13, 2010
  19. Ævar Arnfjörð BjarmasonMay 13, 2010
  20. Peter VereshaginMay 14, 2010
  21. Jakub NarebskiMay 14, 2010
  22. Peter VereshaginMay 14, 2010
  23. Jakub NarebskiMay 14, 2010
  24. Jakub NarebskiMay 14, 2010
  25. Peter VereshaginMay 15, 2010
  26. Jakub NarebskiMay 15, 2010
  27. Peter VereshaginMay 16, 2010
  28. Jakub NarebskiMay 18, 2010
  29. Petr BaudisMay 16, 2010
  30. Petr BaudisMay 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.