代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/nagios 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -up ./startup/default-init.in.fix_el6_init ./startup/default-init.in
--- ./startup/default-init.in.fix_el6_init 2019-01-15 09:58:00.000000000 -0500
+++ ./startup/default-init.in 2019-02-05 09:38:09.463144849 -0500
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# chkconfig: 345 99 01
+# chkconfig: - 99 01
# description: Nagios network monitor
# processname: nagios
# File : nagios
@@ -24,6 +24,9 @@
# - Clean out redhat macros and other dependencies
# 2003-01-11 Ethan Galstad <[email protected]>
# - Updated su syntax (Gary Miller)
+# 2018-11-28 Justin Paulsen <[email protected]>
+# - Patched for EPEL release of Nagioscore 4.4.2
+# - - nagios-0001-default-init.patch
#
# Description: Starts and stops the Nagios monitor
# used to provide network services status.
@@ -91,12 +94,12 @@ check_config ()
echo "ERROR: Could not delete '$NagiosCfgtestFile'"
exit 8
fi
- if ! su $NagiosUser -c "touch $NagiosCfgtestFile"; then
+ if ! su $NagiosUser -c "touch $NagiosCfgtestFile" -s /bin/sh ; then
echo "ERROR: Could not create or update '$NagiosCfgtestFile'"
exit 8
fi
- TMPFILE=$(mktemp /tmp/.configtest.XXXXXXXX)
+ TMPFILE=$(mktemp $NagiosCfgtestFile.XXX)
$NagiosBin -vp $NagiosCfgFile > "$TMPFILE"
WARN=`grep ^"Total Warnings:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
ERR=`grep ^"Total Errors:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g`
@@ -138,11 +141,14 @@ status_nagios ()
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
}
killproc_nagios ()
@@ -157,7 +163,17 @@ pid_nagios ()
return 1
fi
- NagiosPID=`head -n 1 $NagiosRunFile`
+ export NagiosPID=`head -n 1 $NagiosRunFile`
+ if [[ -z "$NagiosPID" ]]; then
+ echo "No usable PID found in $NagiosRunFile"
+ exit 1
+ fi
+
+ regex='^[0-9]+$'
+ if ! [[ $NagiosPID =~ $regex ]]; then
+ echo "PID not number found in $NagiosRunFile"
+ exit 1
+ fi
}
# Check that nagios exists.
@@ -188,7 +204,7 @@ case "$1" in
fi
fi
- su $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"
+ su $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" -s /bin/sh
@BIN_RM@ -f $NagiosCommandFile
touch $NagiosRunFile
$NagiosBin -d $NagiosCfgFile
@@ -281,6 +297,7 @@ case "$1" in
*)
echo "Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig|configtest}"
exit 1
+ exit 2
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。