1) daemon-util patch from https://bugs.gentoo.org/show_bug.cgi?id=513600 make code in /etc/init.d/ganeti redundant. Applicable from app-emulation/ganeti-2.11-2-r2 to app-emulation/ganeti-2.14.1-r1 2) daemon-util is using start-stop-daemon the debian way and so the check_and_start function doesn't work as expected. If the asked PID is not running, the function doesn't launch the process. So the ganeti watcher responsible to launch back missing daemon do nothing at all ! In addition rapi daemon don't have to run on a slave node. Reproducible: Always Steps to Reproduce: 1) only redundant code so no way to reproduce 2) 1. Kill a daemon: kill -15 $(pidof ganeti-confd) 2. Pause the watcher: gnt-cluster watcher pause 1m 3. Try to restart the daemon as the watcher does: /usr/lib64/ganeti/2.14/ganeti/daemon-util check_and_start Actual Results: => the daemon is not started Expected Results: => the daemon is started I join patched files: - init-ganeti.patch - daemon-util.patch
Created attachment 412462 [details, diff] patch for /etc/init.d/ganeti
Created attachment 412464 [details, diff] patch for /usr/lib64/ganeti/2.14/ganeti/daemon-util
the start-stop-daemon part of daemon-util patch could be apply to all ganeti version.
Comment on attachment 412464 [details, diff] patch for /usr/lib64/ganeti/2.14/ganeti/daemon-util Obsolete
Comment on attachment 412462 [details, diff] patch for /etc/init.d/ganeti --- ganeti.orig 2016-09-21 14:39:04.187212153 +0200 +++ ganeti 2016-09-21 14:52:27.106047286 +0200 @@ -13,12 +13,6 @@ DAEMON_UTIL="/usr/lib/ganeti/daemon-util" -is_master() { - [ -z "${ganeti_master}" ] && ganeti_master="$(gnt-cluster getmaster)" - [ -z "${local_hostname}" ] && local_hostname="$(hostname -f)" - [ "${ganeti_master}" = "${local_hostname}" ] -} - # This exists specifically for restarting a 2-node cluster where quorum might # not be available. forcestart() { @@ -43,13 +37,8 @@ for daemon in $(${DAEMON_UTIL} list-start-daemons); do optsvar="$(printf "${daemon}_OPTS" | tr - _ | LC_ALL=C tr '[:lower:]' '[:upper:]')" - - case "${daemon#ganeti-}" in - masterd|rapi|luxid) is_master || continue;; - esac - eval daemon_opts=\"\$\{${optsvar}\}\" - + ebegin "Starting ${daemon}" eindent veinfo ${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts} @@ -87,9 +76,6 @@ local daemon for daemon in $(${DAEMON_UTIL} list-stop-daemons) ; do \ - case "${daemon#ganeti-}" in - masterd|rapi|luxid) is_master || continue;; - esac ${DAEMON_UTIL} stop ${daemon} ${GANETI_OPTS} done }
Created attachment 447034 [details, diff] /etc/init.d/ganeti patch removing duplicate code from /usr/lib/ganeti/daemon-util
This patch works perfectly on ganeti-2.15.2-r5 in production here.
removed.