From ce0cc60346a73372ca967f6311f8a92a924641d7 Mon Sep 17 00:00:00 2001 From: zhipengl Date: Wed, 15 May 2019 07:22:42 +0800 Subject: [PATCH] Fix for pci-irq-affinity-agent failing to start in AIO Ensure that pci-irq-affinity-agent is launched on worker nodes. This includes AIO and standard configs. Root cause is in this agent start script, it can be started only if node type is worker. But for AIO, the node type is controller. Then pmon will restart it again and again and cause controller degrade in the end. Below test for AIO pass 1) Pci-irq-affinity-agent started normally before openstack apply. After openstack apply, related openstack config applied to agent config file as expected. 2) Verified agent started normally in non-openstack worker node for both AIO and multi-node. No degrade in controller node. Change-Id: I73e9dff0358b7ed86bfaaadac834e19fe227892f Closes-Bug: #1828877 Signed-off-by: zhipengl --- .../files/pci-irq-affinity-agent | 63 +++++++------------ 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/utilities/pci-irq-affinity-agent/files/pci-irq-affinity-agent b/utilities/pci-irq-affinity-agent/files/pci-irq-affinity-agent index 600b3d894..71c2db2e5 100755 --- a/utilities/pci-irq-affinity-agent/files/pci-irq-affinity-agent +++ b/utilities/pci-irq-affinity-agent/files/pci-irq-affinity-agent @@ -14,21 +14,10 @@ source /etc/init.d/functions -PLATFORM_CONF="/etc/platform/platform.conf" -NODETYPE="" DAEMON_NAME="pci-irq-affinity-agent" AFFINITYAGENT="/usr/bin/${DAEMON_NAME}" - daemon_pidfile="/var/run/${DAEMON_NAME}.pid" -if [ -f ${PLATFORM_CONF} ] ; then - source ${PLATFORM_CONF} - NODETYPE=${nodetype} -else - logger "$0: ${PLATFORM_CONF} is missing" - exit 1 -fi - if [ ! -f "${AFFINITYAGENT}" ] ; then logger "$0: ${AFFINITYAGENT} is missing" exit 1 @@ -47,41 +36,37 @@ case "$1" in exit 1 fi - if [ ${NODETYPE} = "worker" ] ; then - echo -n "Setting up config for pci-irq-affinity-agent: " + echo -n "Setting up config for pci-irq-affinity-agent: " - if [ -e ${daemon_pidfile} ] ; then - echo "Killing existing process before starting new" - pid=`cat ${daemon_pidfile}` - kill -TERM $pid - rm -f ${daemon_pidfile} - fi + if [ -e ${daemon_pidfile} ] ; then + echo "Killing existing process before starting new" + pid=`cat ${daemon_pidfile}` + kill -TERM $pid + rm -f ${daemon_pidfile} + fi - echo -n "Starting pci-irq-affinity-agent: " - /bin/sh -c "${AFFINITYAGENT}"' >> /dev/null 2>&1 & echo $!' > ${daemon_pidfile} - RETVAL=$? - if [ $RETVAL -eq 0 ] ; then - echo "OK" - touch /var/lock/subsys/${DAEMON_NAME} - else - echo "FAIL" - fi + echo -n "Starting pci-irq-affinity-agent: " + /bin/sh -c "${AFFINITYAGENT}"' >> /dev/null 2>&1 & echo $!' > ${daemon_pidfile} + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + touch /var/lock/subsys/${DAEMON_NAME} + else + echo "FAIL" fi ;; stop) - if [ ${NODETYPE} = "worker" ] ; then - echo -n "Stopping pci-irq-affinity-agent: " + echo -n "Stopping pci-irq-affinity-agent: " - if [ -e ${daemon_pidfile} ] ; then - pid=`cat ${daemon_pidfile}` - kill -TERM $pid - rm -f ${daemon_pidfile} - rm -f /var/lock/subsys/${DAEMON_NAME} - echo "OK" - else - echo "FAIL" - fi + if [ -e ${daemon_pidfile} ] ; then + pid=`cat ${daemon_pidfile}` + kill -TERM $pid + rm -f ${daemon_pidfile} + rm -f /var/lock/subsys/${DAEMON_NAME} + echo "OK" + else + echo "FAIL" fi ;;