From b1a06a0b09d156b029327928d4c9a177e73c4714 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 8 Jan 2009 21:18:24 +0000 Subject: run git-daemon as a user --- files/init.d/git-daemon | 6 ++++-- files/sysconfig/git-daemon | 3 +++ files/sysconfig/git-daemon.vhosts | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'files') diff --git a/files/init.d/git-daemon b/files/init.d/git-daemon index f574480..aed2075 100644 --- a/files/init.d/git-daemon +++ b/files/init.d/git-daemon @@ -16,14 +16,16 @@ export PATH lockfile=${LOCKFILE-/var/lock/subsys/git-daemon} gitdir=${GITDIR-/srv/git} gitvhost=${GITVHOST-no} +user=${GITUSER-nobody} options=${OPTIONS-"--reuseaddr --verbose --detach"} gitdaemon=${GITDAEMON-/usr/bin/git-daemon} RETVAL=0 +gitoptions="--user=${user} ${options}" if [ $gitvhost = yes ]; then - gitoptions="${options} --interpolated-path=${gitdir}/%H/%D" + gitoptions="${gitoptions} --interpolated-path=${gitdir}/%H/%D" else - gitoptions="${options} --base-path=${gitdir}" + gitoptions="${gitoptions} --base-path=${gitdir}" fi # Source function library. diff --git a/files/sysconfig/git-daemon b/files/sysconfig/git-daemon index 92e66f2..a9b208c 100644 --- a/files/sysconfig/git-daemon +++ b/files/sysconfig/git-daemon @@ -15,6 +15,9 @@ # - /srv/git/git.example.org #GITVHOST=no +# the user git-daemon should run with +#GITUSER=nobody + # options for the daemon #OPTIONS="--reuseaddr --verbose --detach" diff --git a/files/sysconfig/git-daemon.vhosts b/files/sysconfig/git-daemon.vhosts index dce800f..62bb9d4 100644 --- a/files/sysconfig/git-daemon.vhosts +++ b/files/sysconfig/git-daemon.vhosts @@ -16,6 +16,9 @@ #GITVHOST=no GITVHOST=yes +# the user git-daemon should run with +#GITUSER=nobody + # options for the daemon #OPTIONS="--reuseaddr --verbose --detach" -- cgit v1.2.3