Bug 1517925 - Updating nagios package causes nagios service to be disabled.
Summary: Updating nagios package causes nagios service to be disabled.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nagios
Version: epel7
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Stephen John Smoogen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-27 17:20 UTC by Mike Willis
Modified: 2019-02-02 00:39 UTC (History)
14 users (show)

Fixed In Version: nagios-4.4.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-02 00:39:37 UTC


Attachments (Terms of Use)

Description Mike Willis 2017-11-27 17:20:36 UTC
Description of problem:

Updating nagios package causes nagios service to be disabled.


Version-Release number of selected component (if applicable):

4.3.4.3.el7


How reproducible:


Steps to Reproduce:
1. Have 4.3.2.8.el7 installed.
2. Run "yum update" and 4.3.4.3.el7 gets installed.
3. Reboot.

Actual results:

nagios service is not running.


Expected results:

nagios service is running.



Additional info:


%post install of  4.3.2.8.el7 contains this:


/usr/bin/systemctl --no-reload preset nagios.service   > /dev/null 2>&1 || :


There's no conditional around it. It should be run only for initial install, not for upgrade. 


Sending all output to /dev/null is unhelpful.

Comment 1 Stephen John Smoogen 2017-11-27 17:28:09 UTC
Thank you for finding that problem. I will put in a fix in the next set of packages though I am not sure why I didn't see this happen on our production boxes before. I will check with Fedora package group if I can safely remove the /dev/null or if it will cause noise or other problems.

Comment 2 Mike Willis 2018-04-16 08:49:05 UTC
This issue is present in nagios-4.3.4-5.el7.

Comment 3 Stephen John Smoogen 2018-04-17 20:28:30 UTC
OK I thought I fixed it but I clearly didn't. There seems to be some logic the %preun is doing when I thought it wouldn't.

Comment 4 Mike Willis 2018-04-18 09:46:35 UTC
I think the problem is in  %post not %pre The commands in %preun have 

if [ $1 -eq 0 ] ; then 
fi

around them which (according to https://fedoraproject.org/wiki/Packaging:Scriptlets) will only be true when the package is being uninstalled. %post still has this in

/usr/bin/systemctl --no-reload preset nagios.service

with no conditional around it and if that's run without sending all the output in to /dev/null this is what's displayed

[root@foo: ~]# /usr/bin/systemctl --no-reload preset nagios.service
Removed symlink /etc/systemd/system/multi-user.target.wants/nagios.service.
[root@foo: ~]# 

I think that command needs to have a conditional around it so that it only gets run on  install, not upgrade. Or maybe it could be removed entirely since there is no systemd preset file in the package and the default is disabled.

Comment 5 R P Herrold 2018-04-18 14:29:46 UTC
As reported in the mailing list, the nagios update bump did NOT disable or remove and enable.  Then again ,I was pre-testing items from smooge. 

My local issue seemed to be stricter parsing of config files, and the problem was made visible by 'pre-flighting' rules (and not the more generic 'weak tea' from systemd)

My rubric to address the matter was:

grep nagios /var/log/messages
  ... and look for noise

   ... this was probably optional, but as it did not rule silently, I 
   ... did 'one off' relabels of editted rules
cd /etc/nagios/
restorecon -Rv nagios.cfg

/usr/sbin/nagios -v /etc/nagios/nagios.cfg
 ... and edit as needed

 ... once it preflights silently:
systemctl restart nagios.service

  ... optionally, as it adds a 'belt and suspenders' enablement:
systemctl enable nagios.service

Comment 6 Mike Willis 2018-04-18 15:27:12 UTC
(In reply to R P Herrold from comment #5)
> As reported in the mailing list, the nagios update bump did NOT disable or
> remove and enable.  

Installing nagios-4.3.4.3.el7  as an update disabled the nagios service on my servers. Installing nagios-4.3.4-5.el7 disabled the nagios service on my servers. I have recreated the issue by installing an older version of the rpm, ensuring the nagios service is enabled, running "yum update", watching the nagios package get updated, then observing that the nagios service is disabled.


> My local issue seemed to be stricter parsing of config files

I don't see the relevance of any of that to the issue I opened this bug report about.

Comment 7 Stephen John Smoogen 2018-04-26 22:39:22 UTC
I have built nagios-4.3.4-10.el7 which should have this fixed in it. It should show up in the epel testing in 1-2 days.

Its upstream build is 

https://koji.fedoraproject.org/koji/taskinfo?taskID=26584394

Please test and let me know

Comment 8 Fedora Update System 2018-04-26 22:39:52 UTC
nagios-4.3.4-10.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-a010142a4d

Comment 9 Mike Willis 2018-04-27 11:28:46 UTC
I've installed the nagios-4.3.4-10.el7 packages and the nagios service is still enabled. :D

What's the reason(s) for sending all output of every command in %post %pre %whatever to /dev/null ?

Comment 10 Stephen John Smoogen 2018-04-27 14:42:48 UTC
The usual reasons are:
1. Output can be sent to the screen in weird ways which tools are not expecting. This can cause tools to crash or do unexpected things.
2. Putting the data in a file can cause problems because it is not tracked by most tools and rpm -Uvh *rpm would fill up various systems.

Comment 11 Fedora Update System 2018-04-28 17:36:05 UTC
nagios-4.3.4-10.el7 has been pushed to the Fedora EPEL 7 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-2018-a010142a4d

Comment 12 Fedora Update System 2018-07-25 00:53:37 UTC
nagios-4.3.4-13.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-41e9ecf98a

Comment 13 Fedora Update System 2018-07-26 11:50:21 UTC
nagios-4.3.4-13.el7 has been pushed to the Fedora EPEL 7 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-2018-41e9ecf98a

Comment 14 Fedora Update System 2018-11-30 19:59:12 UTC
nagios-4.4.2-3.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-0346a55d0f

Comment 15 Fedora Update System 2018-12-01 01:55:46 UTC
nagios-4.4.2-3.el7 has been pushed to the Fedora EPEL 7 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-2018-0346a55d0f

Comment 16 Stephen John Smoogen 2018-12-03 19:57:12 UTC
*** Bug 1568273 has been marked as a duplicate of this bug. ***

Comment 17 Fedora Update System 2019-01-17 00:15:00 UTC
nagios-4.4.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-d661b588d2

Comment 18 Fedora Update System 2019-01-18 01:00:41 UTC
nagios-4.4.3-1.el7 has been pushed to the Fedora EPEL 7 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-2019-d661b588d2

Comment 19 Fedora Update System 2019-02-02 00:39:37 UTC
nagios-4.4.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.