Page 1 of 1

./F-startdaemons with Centos8

Posted: Wed Sep 30, 2020 2:41 pm
by snapier3
Couple of days ago in a development project I encountered an issue with NagiosXI install "F-startdaemons" script while testing on Centos8.

The install process will exit with a failure for the ntpd service restart.


Centos8 now handles ntp via chrony and the xi-sys.cfg still lists the dependency as

Code: Select all

ntpd="ntpd"
In the OEM Script

Code: Select all

#!/bin/bash -e

. ./xi-sys.cfg

# Was previous step completed?
if [ ! -f installed.importnagiosql ]; then
        echo "NagiosQL data was not imported - run previous script" >&2
        exit 1
fi

for svc in $httpd nagios npcd [color=#FF0000]$ntpd[/color] $crond; do
        if [ ! `command -v systemctl` ]; then
            service $svc restart
        else
            systemctl restart $svc
        fi
done

echo "Daemons started OK"
My workaround was to remove the call to $ntpd in the list of services to restart.

Code: Select all

#!/bin/bash -e

. ./xi-sys.cfg

# Was previous step completed?
if [ ! -f installed.importnagiosql ]; then
        echo "NagiosQL data was not imported - run previous script" >&2
        exit 1
fi

for svc in $httpd nagios npcd $crond; do
        if [ ! `command -v systemctl` ]; then
            service $svc restart
        else
            systemctl restart $svc
        fi
done

echo "Daemons started OK"
Removing this service from the list had no impact on the remaining steps in the install process nor the functionality of the NagiosXI.

--SN