]> git.proxmox.com Git - pve-sheepdog.git/commitdiff
Simplify logfile rotation
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 17 Jul 2012 12:48:09 +0000 (14:48 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 17 Jul 2012 12:48:09 +0000 (14:48 +0200)
Makefile
debian/changelog
debian/patches/series
debian/patches/simplify-log-rotation.patch [new file with mode: 0644]

index 34f4dfc31f9fe990395223b91761bb8ec2c1e22e..19f97b88065b59677bd6e310e29af9bf55532198 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.1
 
 PACKAGE=pve-sheepdog
 RELEASE=2.1
 
 PACKAGE=pve-sheepdog
-PKGREL=2
+PKGREL=3
 SDVER=0.4.0
 
 DEB=${PACKAGE}_${SDVER}-${PKGREL}_amd64.deb
 SDVER=0.4.0
 
 DEB=${PACKAGE}_${SDVER}-${PKGREL}_amd64.deb
index eb11040ff1f3b4d77f96e622a587c6cd16b33171..911d68b27d1d77df23a3022749e93b786dae4b40 100644 (file)
@@ -1,3 +1,11 @@
+pve-sheepdog (0.4.0-3) unstable; urgency=low
+
+  * Simplify logfile rotation. We simply rename <logfile> to
+    <logfile>.1. That way we do not need any logrotate script. max_logfile
+    is set to 256MB.
+
+ -- Proxmox Support Team <support@proxmox.com>  Tue, 17 Jul 2012 14:47:32 +0200
+
 pve-sheepdog (0.4.0-2) unstable; urgency=low
 
   * update to master branch
 pve-sheepdog (0.4.0-2) unstable; urgency=low
 
   * update to master branch
index d0de94447bcafc573a14c4ef62343d2bbddf06c1..2fd04b7d51a9d9131dc2404b8fda4e2f038db4f8 100644 (file)
@@ -1,3 +1,4 @@
 disable-test-suite.patch
 fix-manpage-section.patch
 do-not-install-generic-init-script.patch
 disable-test-suite.patch
 fix-manpage-section.patch
 do-not-install-generic-init-script.patch
+simplify-log-rotation.patch
diff --git a/debian/patches/simplify-log-rotation.patch b/debian/patches/simplify-log-rotation.patch
new file mode 100644 (file)
index 0000000..254128b
--- /dev/null
@@ -0,0 +1,34 @@
+simplify logfile rotation
+
+we simply rename <logfile> to <logfile>.1. That way we do not need
+any logrotate script. max_logfile is set to 256MB.
+
+
+Index: new/lib/logger.c
+===================================================================
+--- new.orig/lib/logger.c      2012-07-17 14:40:47.000000000 +0200
++++ new/lib/logger.c   2012-07-17 14:42:16.000000000 +0200
+@@ -57,7 +57,7 @@
+ static pid_t logger_pid;
+ static key_t semkey;
+-static int64_t max_logsize = 500 * 1024 * 1024;  /*500MB*/
++static int64_t max_logsize = 256 * 1024 * 1024;  /*256MB*/
+ pthread_mutex_t logsize_lock = PTHREAD_MUTEX_INITIALIZER;
+@@ -345,13 +345,7 @@
+       if (access(log_nowname, R_OK) == 0) {
+               char old_logfile[256];
+-              time_t t;
+-              struct tm tm;
+-              time(&t);
+-              localtime_r((const time_t *)&t, &tm);
+-              sprintf(old_logfile, "%s.%04d-%02d-%02d-%02d-%02d",
+-                              log_nowname, tm.tm_year + 1900, tm.tm_mon + 1,
+-                              tm.tm_mday, tm.tm_hour, tm.tm_min);
++              sprintf(old_logfile, "%s.1", log_nowname);
+               rename(log_nowname, old_logfile);
+       }
+       new_fd = open(log_nowname, O_RDWR | O_CREAT | O_APPEND, 0644);