Description of problem:
There is a syntax error in the /etc/rc.d/init.d/nagios init script for
the latest update of Nagios in EPEL-6:
# service nagios status
/etc/init.d/nagios: line 153: syntax error near unexpected token `}'
/etc/init.d/nagios: line 153: `}'
This is in the 'printstatus_nagios' function, which looks like
printstatus_nagios ()
{
if status_nagios; then # <-- Spurious line
status_nagios $1 $2
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
return $RETVAL
}
The first line in the body ('if status_nagios; then'; I have marked it
with an arrow above) shouldn't be there. If I comment it out, the init
script works as it should.
This would cause Nagios to not start after a reboot.
Version-Release number of selected component (if applicable):
4.4.3-1.el6.x86_64
Comment 1Stephen John Smoogen
2019-02-05 10:55:05 UTC
*** Bug 1672534 has been marked as a duplicate of this bug. ***
Comment 2Fedora Update System
2019-02-05 15:21:37 UTC
Description of problem: There is a syntax error in the /etc/rc.d/init.d/nagios init script for the latest update of Nagios in EPEL-6: # service nagios status /etc/init.d/nagios: line 153: syntax error near unexpected token `}' /etc/init.d/nagios: line 153: `}' This is in the 'printstatus_nagios' function, which looks like printstatus_nagios () { if status_nagios; then # <-- Spurious line status_nagios $1 $2 RETVAL=$? if [ $RETVAL = 0 ]; then echo "nagios (pid $NagiosPID) is running..." else echo "nagios is not running" fi return $RETVAL } The first line in the body ('if status_nagios; then'; I have marked it with an arrow above) shouldn't be there. If I comment it out, the init script works as it should. This would cause Nagios to not start after a reboot. Version-Release number of selected component (if applicable): 4.4.3-1.el6.x86_64