Bug 1113767 - The ndo2db service fails to start
Summary: The ndo2db service fails to start
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: ndoutils
Version: epel7
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Simone Caronni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-26 21:16 UTC by fedora.dm0
Modified: 2014-07-08 01:01 UTC (History)
2 users (show)

Fixed In Version: ndoutils-2.0.0-7.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-08 00:59:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description fedora.dm0 2014-06-26 21:16:22 UTC
Description of problem:
The ndo2db service dies immediately after starting the service on RHEL7.

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

How reproducible:
Always

Steps to Reproduce:
1. Install ndoutils
2. service ndo2db start

Actual results:
There are two points of failure.  (See additional info.)
1. It will fail due to not being able to open the socket in the parent process.
2. The service immediately exits successfully.

Expected results:
The service should start and continue running.

Additional info:
The first reason it fails is because the socket's parent directory doesn't exist since /var/run is tmpfs on RHEL7, and the tmpfiles.d file is missing from the package.  It should install a /usr/lib/tmpfiles.d/ndoutils.conf, probably containing "d /var/run/ndoutils 0755 nagios nagios -".

Correcting that, it still exits immediately while Type=simple is set in the service file.  Changing it to Type=forking made it run most of the time.  It still decided to immediately exit sporadically, as if there is a race condition.  Maybe this has to do with the fact that it actually forks twice and lets the grandchild process continue, and systemd expects everything to be ready when the parent process exits.

It seems to consistently start and run successfully when the PIDFile line is uncommented, although sometimes systemd prints a warning that it failed to read the PID file (again probably because of a race condition with the parent process exiting and the grandchild process writing the PID).

Comment 1 Simone Caronni 2014-06-27 07:01:48 UTC
(In reply to fedora.dm0 from comment #0)
> The first reason it fails is because the socket's parent directory doesn't
> exist since /var/run is tmpfs on RHEL7, and the tmpfiles.d file is missing
> from the package.  It should install a /usr/lib/tmpfiles.d/ndoutils.conf,
> probably containing "d /var/run/ndoutils 0755 nagios nagios -".

Thanks, I completely forgot. Mostly RHEL 5/6 user here, I made tests only on my system.

http://pkgs.fedoraproject.org/cgit/ndoutils.git/commit/?id=96036382c81cd52e3a2a2bc15adf3727225c8b47

> Correcting that, it still exits immediately while Type=simple is set in the
> service file.  Changing it to Type=forking made it run most of the time.  It
> still decided to immediately exit sporadically, as if there is a race
> condition.  Maybe this has to do with the fact that it actually forks twice
> and lets the grandchild process continue, and systemd expects everything to
> be ready when the parent process exits.
> 
> It seems to consistently start and run successfully when the PIDFile line is
> uncommented, although sometimes systemd prints a warning that it failed to
> read the PID file (again probably because of a race condition with the
> parent process exiting and the grandchild process writing the PID).

Did not experience this in the limited testing I've done on Fedora. I've added both changes (type + pidfile).

http://pkgs.fedoraproject.org/cgit/ndoutils.git/commit/?id=fe201e518cf5b87b174706bd05d914a33f130277

Can you make a test with the builds and see that everything is fixed in 2.0.0-6?

http://koji.fedoraproject.org/koji/packageinfo?packageID=8920

Comment 2 Simone Caronni 2014-06-27 07:02:10 UTC
Are you a packager already? Would you like to become co-maintainer of ndoutils?

Comment 3 Simone Caronni 2014-06-27 07:13:49 UTC
(In reply to Simone Caronni from comment #1)
> Did not experience this in the limited testing I've done on Fedora. I've
> added both changes (type + pidfile).
> 
> http://pkgs.fedoraproject.org/cgit/ndoutils.git/commit/
> ?id=fe201e518cf5b87b174706bd05d914a33f130277

Also added this to the el6/el5 branch (without building), as the spec file allows for rebuilding across all RHEL/Fedora supported distributions.

Comment 4 fedora.dm0 2014-06-27 16:14:43 UTC
(In reply to Simone Caronni from comment #1)
> Can you make a test with the builds and see that everything is fixed in
> 2.0.0-6?
> 
> http://koji.fedoraproject.org/koji/packageinfo?packageID=8920

It's working now, thanks.

A minor issue with the change is that the guidelines[1] say the RPM should still own the /var/run/ndoutils directory when using tmpfiles.d.  Also, the directory is owned by nagios:root in the RPM and nagios:nagios in tmpfiles.d; maybe the same group should be used in both places so "rpm --verify" won't complain about it.

(In reply to Simone Caronni from comment #2)
> Are you a packager already? Would you like to become co-maintainer of
> ndoutils?

No, I'm not a packager in Fedora.  I wouldn't mind co-maintaining ndoutils if you are a sponsor or can ask one about this (according to what I saw on the wiki[2]).  If you'd like to try helping me get sponsored for this and need additional information, perhaps we can discuss it over e-mail.

[1] https://fedoraproject.org/wiki/Packaging:Tmpfiles.d#Example_spec_file
[2] https://fedoraproject.org/wiki/How_to_get_sponsored_into_the_packager_group#Become_a_co-maintainer

Comment 5 Fedora Update System 2014-06-27 17:15:27 UTC
ndoutils-2.0.0-7.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ndoutils-2.0.0-7.fc20

Comment 6 Fedora Update System 2014-06-27 17:15:52 UTC
ndoutils-2.0.0-7.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ndoutils-2.0.0-7.fc19

Comment 7 Fedora Update System 2014-06-29 02:54:17 UTC
Package ndoutils-2.0.0-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ndoutils-2.0.0-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7860/ndoutils-2.0.0-7.fc19
then log in and leave karma (feedback).

Comment 8 lnie 2014-07-01 07:06:38 UTC
ndoutils-2.0.0-7.fc20 works

Comment 9 Fedora Update System 2014-07-08 00:59:49 UTC
ndoutils-2.0.0-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2014-07-08 01:01:36 UTC
ndoutils-2.0.0-7.fc20 has been pushed to the Fedora 20 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.