Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: kill syntax is not working in initscript as reported in an email, kill and the initscripts are having indigestion. The weekend finally prised the testing candidate out into EPEL general Version-Release number of selected component (if applicable): [root@monitor sysconfig]# service nagios restart Running configuration check... Stopping nagios:kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] done. Starting nagios: done. [root@monitor sysconfig]# rpm -q nagios nagios-4.3.4-4.el6.i686 This may well be due to a change in the behavior of 'kill' rather than in Nagios [root@monitor sysconfig]# rpm -qf `which kill ` util-linux-ng-2.17.2-12.28.el6_9.1.i686 ... Release : 12.28.el6_9.1 Build Date: Wed 15 Nov 2017 10:54:43 AM EST ============ I had noticed this elsewhere relevant code: [root@monitor init.d]# grep kill nagios killproc_nagios () kill -s "$1" $NagiosPID killproc_nagios TERM killproc_nagios KILL killproc_nagios HUP [root@monitor init.d]# seems to be on the stop side [root@monitor init.d]# service nagios stop Stopping nagios:kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] done. [root@monitor init.d]# Ask if you wish VM access and I can accomodate -- Russ
I would like to test this in the nagios startup file pid_nagios () { if test ! -f $NagiosRunFile; then echo "No lock file found in $NagiosRunFile" exit 1 fi 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 } The startup script probably needs a rewrite to be RHEL like versus the upstream but I removed that earlier due to other outstanding requests to use upstream.
[root@monitor init.d]# ps ax | grep nag 17066 pts/0 S+ 0:00 grep nag 32182 ? Ss 0:02 /usr/sbin/nagios -d /etc/nagios/nagios.cfg 32184 ? S 0:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 32185 ? S 0:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 32186 ? S 0:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 32187 ? S 0:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh 32250 ? S 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg [root@monitor init.d]# ps afx | grep "nagios [-]d" | head -n 1 ; cat /var/run/nagios/nagios.pid ; ./nagios restart 32182 ? Ss 0:02 /usr/sbin/nagios -d /etc/nagios/nagios.cfg Running configuration check... Stopping nagios:No usable PID found in /var/run/nagios/nagios.pid Starting nagios: done. [root@monitor init.d]# cat /var/run/nagios/nagios.pid [root@monitor init.d]# ps afx | grep "nagios [-]d" | head -n 1 ; cat /var/run/nagios/nagios.pid ; ./nagios stop 32182 ? Ss 0:02 /usr/sbin/nagios -d /etc/nagios/nagios.cfg Stopping nagios:No usable PID found in /var/run/nagios/nagios.pid [root@monitor init.d]# ps afx | grep "nagios [-]d" | head -n 1 ; cat /var/run/nagios/nagios.pid ; ./nagios start 32182 ? Ss 0:02 /usr/sbin/nagios -d /etc/nagios/nagios.cfg Starting nagios: done. [root@monitor init.d]# service nagios restart Running configuration check... Stopping nagios:No usable PID found in /var/run/nagios/nagios.pid Starting nagios: done. [root@monitor init.d]# diff patch file in a moment
Created attachment 1356179 [details] the diff of what I used (which should match yours identically
did this as well, but not material [root@monitor init.d]# restorecon -Rv . restorecon reset /etc/rc.d/init.d/nagios-as_shipped context unconfined_u:object_r:etc_t:s0->unconfined_u:object_r:initrc_exec_t:s0 [root@monitor init.d]#
... so a PID update issue is newly present
nagios-4.3.4-5.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-723d26389e
nagios-4.3.4-5.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-723d26389e
further investigation indicates that when kill is not handed a valid PID, that message results ... just adding this here to help my memory
nagios-4.3.4-6.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-ecb67df0a6
works here -- closing
The initial fix breaks the setup here. Not only that the initscript did contain a syntax error, it also does not stop/kill nagios at all, but it does start a new instance additionally (when using "restart").
https://src.fedoraproject.org/rpms/nagios/c/3d1bdff01b9a4757e2159f98f30c20b9a44afdd2?branch=master - introduces the bug due to wrong patch merging https://src.fedoraproject.org/rpms/nagios/c/a536933d448584ba1683da77798e7baa36daccfd?branch=master - corrects the syntax error https://src.fedoraproject.org/rpms/nagios/c/b18ea19e439a9ff56efce1f779c6acc64ad59c46?branch=master - corrects the restart issue
nagios-4.3.4-7.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-ecb67df0a6
seems to work here with a couple weeks testing several times an hour and no errors
nagios-4.3.4-7.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.