summaryrefslogtreecommitdiff
path: root/git-daemon
diff options
context:
space:
mode:
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>2010-05-22 19:26:06 +0100
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>2010-05-22 19:26:06 +0100
commitc6106de89f45eeb5f684ccfb2627d6259b1f881b (patch)
tree0145b3d054f36a942f276da4719ae98fca2cc3fa /git-daemon
parent70b9d2e0dbecb8fe1e2045a1752465cd35885bb0 (diff)
downloaduserv-utils-c6106de89f45eeb5f684ccfb2627d6259b1f881b.tar.gz
Rotate the logfile
Diffstat (limited to 'git-daemon')
-rw-r--r--git-daemon/Makefile24
-rw-r--r--git-daemon/git-upload-pack.in2
-rw-r--r--git-daemon/inetd.conf.in2
-rw-r--r--git-daemon/logrotate.in6
4 files changed, 25 insertions, 9 deletions
diff --git a/git-daemon/Makefile b/git-daemon/Makefile
index 1a18f66..ad8dd78 100644
--- a/git-daemon/Makefile
+++ b/git-daemon/Makefile
@@ -7,9 +7,16 @@
include ../settings.make
-TARGETS= git-upload-pack inetd.conf git-daemon git-service
+gituser= git
+varloggit= $(varlog)/git
-SUBSTVARS= libuserv etcuserv varlog
+TARGETS= git-upload-pack inetd.conf git-daemon git-service logrotate
+
+SUBSTVARS= libuserv etcuserv varloggit gituser
+
+CONFIGS= $(services)/git-upload-pack \
+ $(etcuserv)/git-urlmap \
+ $(etcdir)/logrotate.d/userv-git-daemon
all: $(TARGETS)
@@ -26,14 +33,17 @@ sedscript: Makefile read-urlmap
mv -f $@.new $@
install: all
- mkdir -p $(libuserv) $(etcuserv) $(services)
+ mkdir -p $(libuserv) $(etcuserv) $(services) \
+ $(etcdir)/logrotate.d
+ install -d -o $(gituser) -g adm $(varloggit)
cp git-daemon git-service $(libuserv)
cp git-upload-pack $(services)/git-upload-pack:new
cp git-urlmap $(etcuserv)/git-urlmap:new
- set -e; cd $(services); test -f git-upload-pack \
- || mv git-upload-pack:new git-upload-pack
- set -e; cd $(etcuserv); test -f git-urlmap \
- || mv git-urlmap:new git-urlmap
+ cp logrotate $(etcdir)/logrotate.d/userv-git-daemon:new
+ set -e; for f in $(CONFIGS); do \
+ if test -f $$f; then continue; fi; \
+ mv $$f:new $$f; \
+ done
clean:
rm -f $(TARGETS)
diff --git a/git-daemon/git-upload-pack.in b/git-daemon/git-upload-pack.in
index c66c61c..bb4e847 100644
--- a/git-daemon/git-upload-pack.in
+++ b/git-daemon/git-upload-pack.in
@@ -6,7 +6,7 @@
if ( grep service-user-shell /etc/shells
& glob service git-upload-pack
- & glob calling-user git
+ & glob calling-user @gituser@
)
reset
errors-to-syslog daemon error
diff --git a/git-daemon/inetd.conf.in b/git-daemon/inetd.conf.in
index 11bf717..f316fcc 100644
--- a/git-daemon/inetd.conf.in
+++ b/git-daemon/inetd.conf.in
@@ -1,2 +1,2 @@
# Example inetd.conf line for the userv git daemon.
-git stream tcp nowait git /usr/sbin/tcpd @libuserv@/git-daemon -L@varlog@/git/userv-git-daemon.log @etcuserv@/git-urlmap
+git stream tcp nowait @gituser@ /usr/sbin/tcpd @libuserv@/git-daemon -L@varloggit@/userv-git-daemon.log @etcuserv@/git-urlmap
diff --git a/git-daemon/logrotate.in b/git-daemon/logrotate.in
new file mode 100644
index 0000000..06e0ef2
--- /dev/null
+++ b/git-daemon/logrotate.in
@@ -0,0 +1,6 @@
+@varloggit@/userv-git-daemon.log {
+ rotate 7
+ daily
+ missingok
+ delaycompress
+}