Bug 1028075

Summary: munin-node doesn't get added to chkconfig
Product: [Fedora] Fedora EPEL Reporter: Jeff Sheltren <sheltren>
Component: muninAssignee: d. johnson <drjohnson1>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: 2229, drjohnson1, ingvar, sheltren
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: munin-2.0.20-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-07 03:26:10 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:

Description Jeff Sheltren 2013-11-07 15:49:43 UTC
Description of problem:
After installing munin-node, it is not included in chkconfig.

# chkconfig --list munin-node
service munin-node supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add munin-node')


Version-Release number of selected component (if applicable):
munin-node-2.0.17-6.el6


Additional info:

Here's the scripts included in the package -- I see a call to remove munin-node from chkconfig on uninstall.  Note the comment about sysvinit, but there's no command directly after it.

preinstall scriptlet (using /bin/sh):
/usr/bin/getent group munin >/dev/null || \
  /usr/sbin/groupadd -r munin
/usr/bin/getent passwd munin >/dev/null || \
  /usr/sbin/useradd -r -g munin -d /var/lib/munin -s /sbin/nologin \
    -c "Munin user" munin
exit 0

#why this? search for BUG above
postinstall scriptlet (using /bin/sh):
# sysvinit only in f15 and older and epel
# Only run configure on a new install, not an upgrade.
if [ "$1" = "1" ]; then
     /usr/sbin/munin-node-configure --shell 2> /dev/null | sh >& /dev/null || :
fi
preuninstall scriptlet (using /bin/sh):
# Older installs use sysvinit / upstart
if [ "$1" = 0 ]; then
  service munin-node stop &>/dev/null || :
  /sbin/chkconfig --del munin-node
fi
postuninstall scriptlet (using /bin/sh):
if [ "$1" = "0" ]; then
  [ -d /etc/munin/plugins ] && \
    find /etc/munin/plugins/ -maxdepth 1 -type l -print0 | \
      xargs -0 rm || :
fi

Comment 1 d. johnson 2013-11-08 00:37:55 UTC
Not sure I follow.  The only services that should be added automatically are listed here:

https://fedoraproject.org/wiki/Starting_services_by_default

Munin is not one of those.

Did you mean something different?

Comment 2 Jeff Sheltren 2013-11-08 16:06:46 UTC
Right, it should not be enabled by default (chkconfig munin-node on), but it should get added to chkconfig when installed (chkconfig --add munin-node), and it's not currently.

I see the chkconfig --add call in the spec file, so it seems the conditional before it may be incorrect.

Comment 3 boss-chifra 2014-03-26 22:07:17 UTC
Agree with "Jeff Sheltren" it should get added to chkconfig when installed (chkconfig --add munin-node and chkconfig --add munin-asyncd), and it's not currently.

Seems the conditional may be incorrect. (in the spec file)

- %if ! 0%{?fedora} > 15 || 0%{?rhel} > 6
+ %if ! 0%{?fedora} > 15 || 0%{?rhel} > 4

Comment 4 d. johnson 2014-03-26 23:27:40 UTC
Ref:

http://pkgs.fedoraproject.org/cgit/munin.git/tree/munin.spec#n542

This says if NOT (fedora > 15) OR (RHEL > 6) run chkconfig.

That is correct.

If you are on a system newer than F15 or EL6, you do not use chkconfig at all. Instead you use systemctl.  The macro for this is:

%systemd_post munin-node.service

Comment 5 boss-chifra 2014-03-26 23:48:33 UTC
But it does not work. I don't see "/sbin/chkconfig --add munin-node" anywhere

-------------------------------------------------------------------------
rpm -qp --scripts munin-node-2.0.19-1.el6.noarch.rpm

preinstall scriptlet (using /bin/sh):
/usr/bin/getent group munin >/dev/null || \
  /usr/sbin/groupadd -r munin
/usr/bin/getent passwd munin >/dev/null || \
  /usr/sbin/useradd -r -g munin -d /var/lib/munin -s /sbin/nologin \
    -c "Munin user" munin
exit 0

#why this? search for BUG above
postinstall scriptlet (using /bin/sh):
# sysvinit only in f15 and older and epel
# Only run configure on a new install, not an upgrade.
if [ "$1" = "1" ]; then
     /usr/sbin/munin-node-configure --shell 2> /dev/null | sh >& /dev/null || :
fi
preuninstall scriptlet (using /bin/sh):
# Older installs use sysvinit / upstart
if [ "$1" = 0 ]; then
  service munin-node stop &>/dev/null || :
  /sbin/chkconfig --del munin-node
fi
postuninstall scriptlet (using /bin/sh):
if [ "$1" = "0" ]; then
  [ -d /etc/munin/plugins ] && \
    find /etc/munin/plugins/ -maxdepth 1 -type l -print0 | \
      xargs -0 rm || :
fi

Comment 6 Fedora Update System 2014-03-27 02:14:31 UTC
munin-2.0.19-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/munin-2.0.19-2.fc20

Comment 7 Fedora Update System 2014-03-27 02:17:03 UTC
munin-2.0.19-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/munin-2.0.19-2.fc19

Comment 8 Fedora Update System 2014-03-27 02:18:25 UTC
munin-2.0.19-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/munin-2.0.19-2.el6

Comment 9 Fedora Update System 2014-03-27 02:19:21 UTC
munin-2.0.19-2.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/munin-2.0.19-2.el5

Comment 10 boss-chifra 2014-03-27 06:39:44 UTC
And if it possible fix chkconfig --add for munin-asyncd, because i think 
this does not work correct
----------------------------------------
%post async
%if ! 0%{?fedora} > 15 || 0%{?rhel} > 6
  /sbin/chkconfig --add munin-asyncd
%endif
%if 0%{?rhel} > 6 || 0%{?fedora} > 15
  %if 0%{?systemd_post:1}
    %systemd_post munin-asyncd.service
  %else
    if [ $1 -eq 1 ] ; then
      # Initial installation
      /bin/systemctl daemon-reload >/dev/null 2>&1 || :
    fi
  %endif
%endif
--------------------------------------------
rpm -qp --scripts munin-async-2.0.19-1.el6.noarch.rpm
postinstall program: /bin/sh

Comment 11 Fedora Update System 2014-03-27 20:43:24 UTC
Package munin-2.0.19-2.el5:
* should fix your issue,
* was pushed to the Fedora EPEL 5 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing munin-2.0.19-2.el5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0971/munin-2.0.19-2.el5
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2014-03-29 13:33:10 UTC
munin-2.0.20-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/munin-2.0.20-1.fc20

Comment 13 Fedora Update System 2014-03-29 13:34:47 UTC
munin-2.0.20-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/munin-2.0.20-1.fc19

Comment 14 Fedora Update System 2014-03-29 13:36:04 UTC
munin-2.0.20-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/munin-2.0.20-1.el6

Comment 15 Fedora Update System 2014-03-29 13:38:08 UTC
munin-2.0.20-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/munin-2.0.20-1.el5

Comment 16 Fedora Update System 2014-04-07 03:26:10 UTC
munin-2.0.20-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2014-04-07 03:26:40 UTC
munin-2.0.20-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2014-04-15 23:29:46 UTC
munin-2.0.20-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2014-04-15 23:30:14 UTC
munin-2.0.20-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.