Socket activation for GitWeb FastCGI with systemd?
- Date: Tue, 03 Apr 2018 21:53:10 +0300
- From: Alex Ivanov <gnidorah@xxxxx>
- Subject: Socket activation for GitWeb FastCGI with systemd?
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
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: gitweb.service: Start request repeated too quickly.
Apr 03 21:32:10 host systemd: gitweb.service: Failed with result 'start-limit-hit'.
Apr 03 21:32:10 host systemd: 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.