Add logrotate example
authorApollon Oikonomopoulos <apoikos@gmail.com>
Tue, 23 Jul 2013 14:22:24 +0000 (17:22 +0300)
committerGuido Trotter <ultrotter@google.com>
Tue, 23 Jul 2013 14:44:07 +0000 (16:44 +0200)
Add an example logrotate snippet, along with the relevant documentation.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

.gitignore
Makefile.am
devel/upload
doc/examples/ganeti.logrotate.in [new file with mode: 0644]
doc/install.rst

index 0ab9ff9..dec19dd 100644 (file)
@@ -66,6 +66,7 @@
 /doc/examples/bash_completion-debug
 /doc/examples/ganeti.cron
 /doc/examples/ganeti.initd
+/doc/examples/ganeti.logrotate
 /doc/examples/ganeti-kvm-poweroff.initd
 /doc/examples/ganeti-master-role.ocf
 /doc/examples/ganeti-node-role.ocf
index ccf23a2..819ffea 100644 (file)
@@ -226,6 +226,7 @@ BUILT_EXAMPLES = \
        doc/examples/ganeti-kvm-poweroff.initd \
        doc/examples/ganeti.cron \
        doc/examples/ganeti.initd \
+       doc/examples/ganeti.logrotate \
        doc/examples/ganeti-master-role.ocf \
        doc/examples/ganeti-node-role.ocf \
        doc/examples/gnt-config-backup \
index 8a897a5..0c26a1a 100755 (executable)
@@ -100,6 +100,10 @@ PKGLIBDIR="$(echo @PKGLIBDIR@ | $SED)"
 install -D --mode=0755 doc/examples/ganeti.initd \
   "$TXD/$SYSCONFDIR/init.d/ganeti"
 
+[ -f doc/examples/ganeti.logrotate ] && \
+install -D --mode=0755 doc/examples/ganeti.logrotate \
+  "$TXD/$SYSCONFDIR/logrotate.d/ganeti"
+
 [ -f doc/examples/ganeti-master-role.ocf ] && \
 install -D --mode=0755 doc/examples/ganeti-master-role.ocf \
   "$TXD/$LIBDIR/ocf/resource.d/ganeti/ganeti-master-role"
diff --git a/doc/examples/ganeti.logrotate.in b/doc/examples/ganeti.logrotate.in
new file mode 100644 (file)
index 0000000..05b1895
--- /dev/null
@@ -0,0 +1,13 @@
+/var/log/ganeti/*.log {
+        weekly
+        missingok
+        rotate 52
+        notifempty
+        compress
+        delaycompress
+        create 640 root root
+        sharedscripts
+        postrotate
+               @PKGLIBDIR@/daemon-util rotate-all-logs
+        endscript
+}
index 99f5083..9ab4646 100644 (file)
@@ -566,7 +566,10 @@ distribution's startup scripts, for example in Debian::
 In order to automatically restart failed instances, you need to setup a
 cron job run the *ganeti-watcher* command. A sample cron file is
 provided in the source at ``doc/examples/ganeti.cron`` and you can copy
-that (eventually altering the path) to ``/etc/cron.d/ganeti``.
+that (eventually altering the path) to ``/etc/cron.d/ganeti``. Finally,
+a sample logrotate snippet is provided in the source at
+``doc/examples/ganeti.logrotate`` and you can copy it to
+``/etc/logrotate.d/ganeti`` to have Ganeti's logs rotated automatically.
 
 What gets installed
 ~~~~~~~~~~~~~~~~~~~