View Issue Details

IDProjectCategoryView StatusLast Update
0015784CentOS-6-OTHERpublic2019-02-11 17:07
ReporterFireMaster 
PriorityhighSeverityblockReproducibilityalways
Status newResolutionopen 
Platformx86_64OSCentOS 6OS Version6.10
Product Version6.10 
Target VersionFixed in Version 
Summary0015784: broken /etc/init.d/nagios script
DescriptionHello. This week I update nagios and nagios-common from epel release and init.d script for nagios restart is broken. I try to remove and install clean the packages again, I still have the problem.

[root@nagios ~]# /etc/init.d/nagios
/etc/init.d/nagios: line 153: syntax error near unexpected token `}'
/etc/init.d/nagios: line 153: `}'

The version of packages are:

nagios-common-4.4.3-1.el6.x86_64
nagios-4.4.3-1.el6.x86_64

TagsNo tags attached.

Activities

1midniterider

1midniterider

2019-02-08 19:48

reporter   ~0033796

I think I see the issue… Make sure you back up the new init.d script, then, in the new init.d script, search for printstatus_nagios you should see this:
 
printstatus_nagios ()
{
       if status_nagios; then
       status_nagios $1 $2
       RETVAL=$?
       if [ $RETVAL = 0 ]; then
              echo "nagios (pid $NagiosPID) is running..."
       else
              echo "nagios is not running"
       fi
       return $RETVAL
}
 
Change it to this:
 
printstatus_nagios ()
{
       if status_nagios; then
              status_nagios $1 $2
       fi
       RETVAL=$?
       if [ $RETVAL = 0 ]; then
              echo "nagios (pid $NagiosPID) is running..."
       else
              echo "nagios is not running"
       fi
       return $RETVAL
}
FireMaster

FireMaster

2019-02-11 12:51

reporter   ~0033802

Dear 1midniterider,
thanks for you reply.

Everything works correctly now. Many thanks for the help.

Best wishes.
1midniterider

1midniterider

2019-02-11 17:07

reporter   ~0033804

No worries

Issue History

Date Modified Username Field Change
2019-02-05 12:14 FireMaster New Issue
2019-02-08 19:48 1midniterider Note Added: 0033796
2019-02-11 12:51 FireMaster Note Added: 0033802
2019-02-11 17:07 1midniterider Note Added: 0033804