]> err.no Git - varnish/commitdiff
Add log rotation for /var/log/varnish/varnish.log
authorssm <ssm@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 May 2007 15:33:41 +0000 (15:33 +0000)
committerssm <ssm@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 May 2007 15:33:41 +0000 (15:33 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1463 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/debian/dirs
varnish-cache/debian/rules
varnish-cache/debian/varnish.logrotate [new file with mode: 0644]
varnish-cache/debian/varnish.varnishlog.init

index b591f2d844bcf99194d795598998cee6806b7be0..1e28e13628d94c456f6ed6b2d6af7b6214b8dd8c 100644 (file)
@@ -1,4 +1,5 @@
 etc/varnish
+etc/logrotate.d
 usr/bin
 usr/lib
 usr/sbin
index 9d7b890435b3190104d7695c4d852e0c6d4f5023..5be9d81f03236173e23bf28eaf8249f3aaa95c3e 100755 (executable)
@@ -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.
diff --git a/varnish-cache/debian/varnish.logrotate b/varnish-cache/debian/varnish.logrotate
new file mode 100644 (file)
index 0000000..365cf7c
--- /dev/null
@@ -0,0 +1,9 @@
+/var/log/varnish/varnish.log {
+  daily
+  rotate 7
+  compress
+  delaycompress
+  postrotate
+    /usr/sbin/invoke-rc.d varnishlog reload > /dev/null
+  endscript
+}
index def543a20faf6b782cb447b82700c66656661f5b..26af531963bd299e457aa9be498f41c49a03786f 100755 (executable)
@@ -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