Add log rotation for /var/log/varnish/varnish.log

git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1463 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 65621576
etc/varnish
etc/logrotate.d
usr/bin
usr/lib
usr/sbin
......
......@@ -69,6 +69,7 @@ install: build
$(MAKE) install DESTDIR=$(CURDIR)/debian/varnish
install -m 644 $(CURDIR)/etc/default.vcl $(CURDIR)/debian/varnish/etc/varnish/
install -m 644 $(CURDIR)/debian/lintian-override $(CURDIR)/debian/varnish/usr/share/lintian/overrides/varnish
install -m 644 $(CURDIR)/debian/varnish.logrotate $(CURDIR)/debian/varnish/etc/logrotate.d/varnish
# Build architecture-independent files here.
......
/var/log/varnish/varnish.log {
daily
rotate 7
compress
delaycompress
postrotate
/usr/sbin/invoke-rc.d varnishlog reload > /dev/null
endscript
}
......@@ -52,12 +52,22 @@ case "$1" in
log_end_msg 1
fi
;;
reload)
log_daemon_msg "Reloading $DESC"
log_progress_msg $NAME
if kill -HUP $(cat $PIDFILE) >/dev/null 2>&1; then
log_end_msg 0
else
log_end_msg 1
exit 1
fi
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload}"
log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}"
exit 1
;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment