diff options
author | Johan Sørensen <johan@johansorensen.com> | 2009-05-15 11:39:39 +0200 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2009-05-15 11:39:39 +0200 |
commit | 06c39c46d397d9b0097654c9a4f0d2e7daf0d074 (patch) | |
tree | 3a03899b6d179c5c73aa44e7ea94fb22368db96d /script/git-daemon | |
parent | 3da39da1b11ea75472d0e11a1ca09b80e7c570c9 (diff) | |
download | gitorious-mainline-outdated-06c39c46d397d9b0097654c9a4f0d2e7daf0d074.zip gitorious-mainline-outdated-06c39c46d397d9b0097654c9a4f0d2e7daf0d074.tar.gz gitorious-mainline-outdated-06c39c46d397d9b0097654c9a4f0d2e7daf0d074.tar.bz2 |
Make sure the --pidfile argument to the git-daemon actually works and chdir to
the repository root
Diffstat (limited to 'script/git-daemon')
-rwxr-xr-x | script/git-daemon | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/script/git-daemon b/script/git-daemon index 7e852a6..2524d54 100755 --- a/script/git-daemon +++ b/script/git-daemon @@ -35,9 +35,6 @@ module Git def start if @options[:daemonize] daemonize(@options[:logfile]) - File.open(@options[:pidfile], "w") do |f| - f.write(Process.pid) - end end @socket = TCPServer.new(@options[:host], @options[:port]) @socket.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, !!@options[:reuseaddr]) @@ -48,6 +45,12 @@ module Git end def run + Dir.chdir(GitoriousConfig["repository_base_path"]) + if @options[:pidfile] + File.open(@options[:pidfile], "w") do |f| + f.write(Process.pid) + end + end while session = accept_socket connections = $children_active - $children_reaped if connections > MAX_CHILDREN |