#!/bin/bash
set -e
# Start fcgiwrap as git user
spawn-fcgi -s /var/run/fcgiwrap.socket -U nginx -u git -g git -- /usr/sbin/fcgiwrap
# Make sure nginx can access the socket
chmod 660 /var/run/fcgiwrap.socket
# Start nginx in foreground
exec nginx -g 'daemon off;'