This email is a fyi for the zenoss rpm builder for the next release.
I could not understand why the default zenoss rpm install overwritten my
snmpd.conf every time I did a fresh install when I have a snmpd.conf in
place already.
After doing some investigation I see what is happening.
here is the snmpd section of the /etc/init.d/zenoss
# update the snmpd.conf file
SNMPD_CONF_DIR=`dirname ${SNMPD_CONF}`
BACKUP=${SNMPD_CONF_DIR}/`basename ${SNMPD_CONF}`.orig
if [ -f ${SNMPD_CONF} ]; then
cp ${SNMPD_CONF} ${BACKUP}
fi
if [ ! -d ${SNMPD_CONF_DIR} ]; then
mkdir -p ${SNMPD_CONF_DIR}
fi
cp ${ZEN_ETC}/snmpd.conf ${SNMPD_CONF}
here is the culprit...
cp ${ZEN_ETC}/snmpd.conf ${SNMPD_CONF}
this is outside of the if statement
I have to rebuild zenoss rpm from tar ball using the spec file that
comes with it with quite a few modifications to fit our current
environment.
I added these 2 sed lines in the %build section
There might be other ways to do this but this is the way I chose to do
it.
sed -i ${START_SCRIPT} -e "s/cp \${ZEN_ETC}\/snmpd.conf \{SNMPD_CONF}//"
sed -i ${START_SCRIPT} -e "s/mkdir -p \${SNMPD_CONF_DIR}/mkdir -p \
${SNMPD_CONF_DIR}\\n\\tcp \${ZEN_ETC}\/snmpd.conf \${SNMPD_CONF}/"
this did the trick. made the script look like this instead.
if [ ! -d ${SNMPD_CONF_DIR} ]; then
mkdir -p ${SNMPD_CONF_DIR}
cp ${ZEN_ETC}/snmpd.conf ${SNMPD_CONF}
fi
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users