[Pkg-ganeti-devel] [SCM] Ganeti packaging branch, master, updated. debian/2.7.0-1-41-g3949c6c

Apollon Oikonomopoulos apoikos at gmail.com
Tue Jul 23 10:53:03 UTC 2013


The following commit has been merged in the master branch:
commit 3949c6c098d5634ce712040cdeb7c2a9b9e9d49e
Author: Apollon Oikonomopoulos <apoikos at gmail.com>
Date:   Tue Jul 23 13:39:31 2013 +0300

    Add logrotate snippet

diff --git a/debian/changelog b/debian/changelog
index 3041b17..d5ac317 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ ganeti (2.7.0-2) unstable; urgency=low
     - Use the dh sequencer and cleanup debian/rules
     - Switch from dh_pysupport to dh_python2
     - Run the upstream test suite during build
+  * Provide the /etc/logrotate.d/ganeti snippet
   * Ship the majority of the Python code in a private module under
     /usr/share/ganeti
   * Ship the RAPI client as a separate package (python-ganeti-rapi)
diff --git a/debian/ganeti.logrotate b/debian/ganeti.logrotate
new file mode 100644
index 0000000..a81a7e2
--- /dev/null
+++ b/debian/ganeti.logrotate
@@ -0,0 +1,13 @@
+/var/log/ganeti/*.log {
+        weekly
+        missingok
+        rotate 52
+        notifempty
+        compress
+        delaycompress
+        create 640 root root
+        sharedscripts
+        postrotate
+		/usr/lib/ganeti/daemon-util rotate-all
+        endscript
+}
diff --git a/debian/patches/0001-daemon-util-provide-rotate-and-rotate_all-actions.patch b/debian/patches/0001-daemon-util-provide-rotate-and-rotate_all-actions.patch
new file mode 100644
index 0000000..ce5de22
--- /dev/null
+++ b/debian/patches/0001-daemon-util-provide-rotate-and-rotate_all-actions.patch
@@ -0,0 +1,58 @@
+From 92113d5551ef1bacb17aa66b0facda162bec158a Mon Sep 17 00:00:00 2001
+From: Apollon Oikonomopoulos <apoikos at gmail.com>
+Date: Tue, 23 Jul 2013 13:09:20 +0300
+Subject: [PATCH stable-2.7 1/2] daemon-util: provide rotate and rotate_all
+ actions
+
+Modify daemon-util to allow sending SIGHUP to one or all daemons. This is meant
+as a utility function to be used in logrotate definitions.
+
+Signed-off-by: Apollon Oikonomopoulos <apoikos at gmail.com>
+Forwarded: yes
+Last-Update: 2013-07-23
+---
+ daemons/daemon-util.in |   28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 9481dc0..1d54979 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -311,6 +311,34 @@ stop_all() {
+   done
+ }
+ 
++# SIGHUP a process to force re-opening its logfiles
++rotate() {
++  if [[ "$#" -lt 1 ]]; then
++    echo 'Missing daemon name.' >&2
++    return 1
++  fi
++
++  local name="$1"; shift
++  local pidfile=$(_daemon_pidfile $name)
++  local daemonexec=$(_daemon_executable $name)
++
++  if type -p start-stop-daemon >/dev/null; then
++    start-stop-daemon --stop --signal HUP --quiet \
++      --pidfile $pidfile
++  else
++    _ignore_error killproc \
++      -p $pidfile \
++      $daemonexec -HUP
++  fi
++}
++
++# SIGHUP all processes
++rotate_all() {
++  for i in $(list_stop_daemons); do
++    rotate $i
++  done
++}
++
+ # Reloads the SSH keys
+ reload_ssh_keys() {
+   @RPL_SSH_INITD_SCRIPT@ restart
+-- 
+1.7.10.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 7011cb7..bbec817 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 fix-startup-with-old-config.patch
 cfgupgrade12-remove-old-ssconf.patch
 0003-Disable-local-checks-during-build.patch
+0001-daemon-util-provide-rotate-and-rotate_all-actions.patch

-- 
Ganeti packaging



More information about the Pkg-ganeti-devel mailing list