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 <zhipengs.liu@intel.com>
This commit is contained in:
zhipengl 2019-05-15 07:22:42 +08:00 committed by zhipeng liu
parent ed50f0230d
commit ce0cc60346
1 changed files with 24 additions and 39 deletions

View File

@ -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
;;