Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 561044

Summary: app-emulation/ganeti: clean init.d
Product: Gentoo Linux Reporter: Zentoo <b4b1>
Component: Current packagesAssignee: Patrick McLean <chutzpah>
Status: RESOLVED OBSOLETE    
Severity: major CC: b4b1, virtualization
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Deadline: 2020-09-21   
Attachments: patch for /etc/init.d/ganeti
patch for /usr/lib64/ganeti/2.14/ganeti/daemon-util
/etc/init.d/ganeti patch removing duplicate code from /usr/lib/ganeti/daemon-util

Description Zentoo 2015-09-21 15:45:12 UTC
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
Comment 1 Zentoo 2015-09-21 15:46:13 UTC
Created attachment 412462 [details, diff]
patch for /etc/init.d/ganeti
Comment 2 Zentoo 2015-09-21 15:47:07 UTC
Created attachment 412464 [details, diff]
patch for /usr/lib64/ganeti/2.14/ganeti/daemon-util
Comment 3 Zentoo 2015-09-21 15:52:37 UTC
the start-stop-daemon part of daemon-util patch could be apply to all ganeti version.
Comment 4 Zentoo 2016-09-21 12:54:37 UTC
Comment on attachment 412464 [details, diff]
patch for /usr/lib64/ganeti/2.14/ganeti/daemon-util

Obsolete
Comment 5 Zentoo 2016-09-21 12:57:48 UTC
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
 }
Comment 6 Zentoo 2016-09-21 13:00:42 UTC
Created attachment 447034 [details, diff]
/etc/init.d/ganeti patch removing duplicate code from /usr/lib/ganeti/daemon-util
Comment 7 Zentoo 2016-09-21 13:02:23 UTC
This patch works perfectly on ganeti-2.15.2-r5 in production here.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-09-21 07:33:58 UTC
removed.