[SCM] gerbera/master: Update logrotate settings used by sysvinit

jcowgill at users.alioth.debian.org jcowgill at users.alioth.debian.org
Sat Sep 23 17:48:16 UTC 2017


The following commit has been merged in the master branch:
commit 12a4b8c9fa358078b6bc367f731ae505a1b9d117
Author: James Cowgill <jcowgill at debian.org>
Date:   Sat Sep 16 22:41:26 2017 +0100

    Update logrotate settings used by sysvinit
    
    - Rotate monthly, keeping 4 old copies.
    - Compress old logs.
    - Have logrotate create new log file so gerbera can write to it.
    - Add patch so that reloading gerbera switches log files properly.

diff --git a/debian/gerbera.logrotate b/debian/gerbera.logrotate
index cfe1f18..635ae0c 100644
--- a/debian/gerbera.logrotate
+++ b/debian/gerbera.logrotate
@@ -1,7 +1,10 @@
 "/var/log/gerbera.log" {
-	weekly
-	rotate 12
+	monthly
+	rotate 4
 	missingok
+	notifempty
+	compress
+	create
 	postrotate
 		invoke-rc.d gerbera reload >/dev/null
 	endscript
diff --git a/debian/patches/0012_reload-log-on-hup.patch b/debian/patches/0012_reload-log-on-hup.patch
new file mode 100644
index 0000000..df4b08c
--- /dev/null
+++ b/debian/patches/0012_reload-log-on-hup.patch
@@ -0,0 +1,38 @@
+Description: Re-open log file on SIGHUP
+ When SIGHUP is received, re-open the log file so that logrotate works
+ properly.
+Author: James Cowgill <jcowgill at debian.org>
+Forwarded: no
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -115,6 +115,7 @@ int main(int argc, char** argv, char** e
+     String magic;
+     bool debug_logging = false;
+     bool print_version = false;
++    char* log_file = nullptr;
+ 
+     Ref<Array<StringBase> > addFile(new Array<StringBase>());
+ 
+@@ -180,6 +181,7 @@ int main(int argc, char** argv, char** e
+ 
+         case 'l':
+             log_debug("Log file: %s\n", optarg);
++            log_file = optarg;
+             log_open(optarg);
+             break;
+ 
+@@ -438,6 +440,12 @@ For more information visit " DESC_MANUFA
+                     exit(EXIT_FAILURE);
+                 }
+ 
++                // Re-open log file
++                if (log_file != nullptr) {
++                    log_close();
++                    log_open(log_file);
++                }
++
+                 ///  \todo fix this for SIGHUP
+                 server = Server::getInstance();
+                 server->upnp_init();
diff --git a/debian/patches/series b/debian/patches/series
index fcbdde5..3bb00e6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0009_CMake-Improve-compat-with-libupnp-1.8.2.patch
 0010_Unqualify-libupnp-includes.patch
 0011_duktape-nolib.patch
+0012_reload-log-on-hup.patch

-- 
gerbera packaging



More information about the pkg-multimedia-commits mailing list