Commit 24f8fca3 authored by Guido Trotter's avatar Guido Trotter

Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Update NEWS and version for Ganeti 2.7.1
  daemon-util: pass --oknodo at rotate_logs
  Add logrotate example
  daemon-util: provide rotate_logs and rotate_all_logs actions

Conflicts:
	NEWS: trivial
	configure.ac: trivial (keep 2.8 version)
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parents 8a534fbe 1646848f
......@@ -68,6 +68,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
......
......@@ -244,6 +244,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 \
......
......@@ -74,6 +74,20 @@ For Python:
- ``yaml`` library (only for running the QA).
Version 2.7.1
-------------
*(Released Thu, 25 Jul 2013)*
- Add logrotate functionality in daemon-util
- Add logrotate example file
- Add missing fields to network queries over rapi
- Fix network object timestamps
- Add support for querying network timestamps
- Fix a typo in the example crontab
- Fix a documentation typo
Version 2.7.0
-------------
......
......@@ -324,6 +324,34 @@ stop_all() {
done
}
# SIGHUP a process to force re-opening its logfiles
rotate_logs() {
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 \
--oknodo --pidfile $pidfile
else
_ignore_error killproc \
-p $pidfile \
$daemonexec -HUP
fi
}
# SIGHUP all processes
rotate_all_logs() {
for i in $(list_stop_daemons); do
rotate_logs $i
done
}
# Reloads the SSH keys
reload_ssh_keys() {
@RPL_SSH_INITD_SCRIPT@ restart
......
......@@ -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"
......
/var/log/ganeti/*.log {
weekly
missingok
rotate 52
notifempty
compress
delaycompress
create 640 root root
sharedscripts
postrotate
@PKGLIBDIR@/daemon-util rotate-all-logs
endscript
}
......@@ -567,7 +567,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
~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment