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

Socket activation for GitWeb FastCGI with systemd?

From
AIAlex Ivanov <gnidorah@ya.ru>
Date
Apr 3, 2018, 18:53 UTC
Message-ID
<671541522781590@web3o.yandex.ru>

Hi. I want to use systemd as fastcgi spawner for gitweb + nginx. The traffic is low and number of users is limited + traversal bots. For that reason I've decided to use following mimimal services

gitweb.socket [Unit] Description=GitWeb Socket

[Socket] ListenStream=/run/gitweb.sock Accept=false

[Install] WantedBy=sockets.target

gitweb.service [Unit] Description=GitWeb Service

[Service] Type=simple ExecStart=/path/to/gitweb.cgi --fcgi StandardInput=socket

However this scheme is not resistant to simple DDOS. E.g. traversal bots often kill the service by opening non existing path (e.g http://host/?p=repo;a=blob;f=nonexisting/path;hb=HEAD showing in browser 404 - Cannot find file) many times consecutively, which leads to Apr 03 21:32:10 host systemd[1]: gitweb.service: Start request repeated too quickly. Apr 03 21:32:10 host systemd[1]: gitweb.service: Failed with result 'start-limit-hit'. Apr 03 21:32:10 host systemd[1]: Failed to start GitWeb service. and 502 Bad Gateway in browser. I believe the reason is that gitweb.service dies on failure and if it happens too often, systemd declines to restart the service due to start limit hit. So my question is how to correct systemd services for GitWeb to be resistant to such issue? I prefer to use single process to process all clients. Thanks.

Next: Jacob Keller
Message 1 of 3 in “Socket activation for GitWeb FastCGI with systemd?”
  1. Alex IvanovApr 3, 2018
  2. Jacob KellerApr 3, 2018
  3. Alex IvanovApr 4, 2018

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.