/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
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 \
- ``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
-------------
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
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"
--- /dev/null
+/var/log/ganeti/*.log {
+ weekly
+ missingok
+ rotate 52
+ notifempty
+ compress
+ delaycompress
+ create 640 root root
+ sharedscripts
+ postrotate
+ @PKGLIBDIR@/daemon-util rotate-all-logs
+ endscript
+}
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
~~~~~~~~~~~~~~~~~~~
DAEMONS_LOGBASE = {
NODED: "node-daemon",
CONFD: "conf-daemon",
- LUXID: "query-daemon",
+ LUXID: "luxi-daemon",
RAPI: "rapi-daemon",
MASTERD: "master-daemon",
MOND: "monitoring-daemon",
HV_VIF_TYPE = "vif_type"
HV_VIF_SCRIPT = "vif_script"
HV_XEN_CMD = "xen_cmd"
+HV_VNET_HDR = "vnet_hdr"
HVS_PARAMETER_TYPES = {
HV_VIF_TYPE: VTYPE_STRING,
HV_VIF_SCRIPT: VTYPE_STRING,
HV_XEN_CMD: VTYPE_STRING,
+ HV_VNET_HDR: VTYPE_BOOL,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
HV_VGA: "",
HV_KVM_EXTRA: "",
HV_KVM_MACHINE_VERSION: "",
+ HV_VNET_HDR: True,
},
HT_FAKE: {
HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
constants.HV_VGA: hv_base.NO_CHECK,
constants.HV_KVM_EXTRA: hv_base.NO_CHECK,
constants.HV_KVM_MACHINE_VERSION: hv_base.NO_CHECK,
+ constants.HV_VNET_HDR: hv_base.NO_CHECK,
}
_VIRTIO = "virtio"
devlist = self._GetKVMOutput(kvm_path, self._KVMOPT_DEVICELIST)
if self._NEW_VIRTIO_RE.search(devlist):
nic_model = self._VIRTIO_NET_PCI
- vnet_hdr = True
+ vnet_hdr = up_hvp[constants.HV_VNET_HDR]
except errors.HypervisorError, _:
# Older versions of kvm don't support DEVICE_LIST, but they don't
# have new virtio syntax either.
I_FIELDS = ["name", "admin_state", "os",
"pnode", "snodes",
"disk_template",
- "nic.ips", "nic.macs", "nic.modes",
+ "nic.ips", "nic.macs", "nic.modes", "nic.uuids", "nic.names",
"nic.links", "nic.networks", "nic.networks.names", "nic.bridges",
"network_port",
- "disk.sizes", "disk.spindles", "disk_usage",
+ "disk.sizes", "disk.spindles", "disk_usage", "disk.uuids",
+ "disk.names",
"beparams", "hvparams",
"oper_state", "oper_ram", "oper_vcpus", "status",
"custom_hvparams", "custom_beparams", "custom_nicparams",
self.noded_uid = GetUid(constants.NODED_USER, _getpwnam)
self.noded_gid = GetGid(constants.NODED_GROUP, _getgrnam)
+ self.mond_uid = GetUid(constants.MOND_USER, _getpwnam)
+ self.mond_gid = GetGid(constants.MOND_GROUP, _getgrnam)
+
# Misc Ganeti groups
self.daemons_gid = GetGid(constants.DAEMONS_GROUP, _getgrnam)
self.admin_gid = GetGid(constants.ADMIN_GROUP, _getgrnam)
self.luxid_uid: constants.LUXID_USER,
self.rapi_uid: constants.RAPI_USER,
self.noded_uid: constants.NODED_USER,
+ self.mond_uid: constants.MOND_USER,
}
self._gid2group = {
self.luxid_gid: constants.LUXID_GROUP,
self.rapi_gid: constants.RAPI_GROUP,
self.noded_gid: constants.NODED_GROUP,
+ self.mond_gid: constants.MOND_GROUP,
self.daemons_gid: constants.DAEMONS_GROUP,
self.admin_gid: constants.ADMIN_GROUP,
}
masterd_log = constants.DAEMONS_LOGFILES[constants.MASTERD]
noded_log = constants.DAEMONS_LOGFILES[constants.NODED]
confd_log = constants.DAEMONS_LOGFILES[constants.CONFD]
+ luxid_log = constants.DAEMONS_LOGFILES[constants.LUXID]
rapi_log = constants.DAEMONS_LOGFILES[constants.RAPI]
+ mond_log = constants.DAEMONS_LOGFILES[constants.MOND]
rapi_dir = os.path.join(pathutils.DATA_DIR, "rapi")
cleaner_log_dir = os.path.join(pathutils.LOG_DIR, "cleaner")
(pathutils.LOG_DIR, DIR, 0770, getent.masterd_uid, getent.daemons_gid),
(masterd_log, FILE, 0600, getent.masterd_uid, getent.masterd_gid, False),
(confd_log, FILE, 0600, getent.confd_uid, getent.masterd_gid, False),
+ (luxid_log, FILE, 0600, getent.luxid_uid, getent.masterd_gid, False),
(noded_log, FILE, 0600, getent.noded_uid, getent.masterd_gid, False),
(rapi_log, FILE, 0600, getent.rapi_uid, getent.masterd_gid, False),
+ (mond_log, FILE, 0600, getent.mond_uid, getent.masterd_gid, False),
(pathutils.LOG_OS_DIR, DIR, 0750, getent.noded_uid, getent.daemons_gid),
(pathutils.LOG_XEN_DIR, DIR, 0750, getent.noded_uid, getent.daemons_gid),
(cleaner_log_dir, DIR, 0750, getent.noded_uid, getent.noded_gid),
getServer setOwner path = do
s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
S.bindSocket s (S.SockAddrUnix path)
- when setOwner . setOwnerAndGroupFromNames path GanetiConfd $
+ when setOwner . setOwnerAndGroupFromNames path GanetiLuxid $
ExtraGroup DaemonsGroup
S.listen s 5 -- 5 is the max backlog
return s