Bug 1515445
Summary: | initscript 'kill' is mis-behaving in Nagios stop initscript | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | R P Herrold <herrold> | ||||
Component: | nagios | Assignee: | Stephen John Smoogen <smooge> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | el6 | CC: | affix, athmanem, b.heden, jose.p.oliveira.oss, lemenkov, linux, redhat-bugzilla, shawn.starr, smooge, smooge, s, swilkerson | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | nagios-4.3.4-7.el6 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2017-12-08 19:35:50 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
R P Herrold
2017-11-20 19:36:44 UTC
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. |