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)
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)
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
# 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