Bug 1112770 - New package erlang-sd_notify
Summary: New package erlang-sd_notify
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: erlang-sd_notify
Version: 5.0 (RHEL 7)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: z3
: 5.0 (RHEL 7)
Assignee: Lon Hohberger
QA Contact: Ami Jeain
URL:
Whiteboard:
Depends On:
Blocks: 1131678 1165216
TreeView+ depends on / blocked
 
Reported: 2014-06-24 16:14 UTC by John Eckersberg
Modified: 2015-09-09 23:24 UTC (History)
8 users (show)

Fixed In Version: erlang-sd_notify-0.1-2.el7ost
Doc Type: Enhancement
Doc Text:
With this update, a new package, erlang-sd_notify is included. This package is required for rebasing rabbitmq-server to version 3.3.5. As a result, rabbitmq-server now supports the systemd notify mechanism.
Clone Of:
Environment:
Last Closed: 2014-12-02 15:24:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1935 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Bug Fix and EnhancementAdvisory 2014-12-02 20:23:32 UTC

Description John Eckersberg 2014-06-24 16:14:39 UTC
erlang-sd_notify is a small library that wraps the sd_notify function from libsystemd-daemon.  There is an upstream Fedora bug (bug 1103524) that tracks switching the rabbitmq-server package to use erlang-sd_notify in order to change the rabbitmq-server.service unit to type=notify.  This is the desired and correct behavior to remove several hacks in the current unit.  The current unit looks like this:

[Service]
Type=simple
User=rabbitmq
Group=rabbitmq
Environment=RABBITMQ_PID_FILE=/var/run/rabbitmq/pid
WorkingDirectory=/var/lib/rabbitmq
# Ensure cookie is created to avoid race
# See https://bugzilla.redhat.com/show_bug.cgi?id=1059913
ExecStartPre=-/bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl status > /dev/null 2>&1"
ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server
ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmqctl wait /var/run/rabbitmq/pid
ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop
ExecStopPost=/usr/bin/rm /var/run/rabbitmq/pid


Some notes:

- The ExecStartPost is needed because this service is of type=simple.  Simple services are expected to be available via managed sockets, and that once the ExecStart process has been executed, the service can be considered started.  Any interaction with the service during boot time is to be done via the managed socket and processed once the service finishes starting.  That is not the case with rabbitmq-server.  It does not support inheriting sockets from systemd, so the service must artificially wait before the unit is considered started.  Thus the "rabbitmqctl wait" command.

- The ExecStartPre is needed because of a race between ExecStart and ExecStartPost.  See bug 1059913 for details.

- ExecStopPost is needed to ensure the pidfile is removed, since ExecStartPost will wait on that file during the next startup.

So all of these things are interrelated, and they're all hacks to paper over the fact that simple services aren't really supposed to work like this.

Switching over to using sd_notify allows the service unit to look like this instead:

[Service]
Type=notify
User=rabbitmq
Group=rabbitmq
WorkingDirectory=/var/lib/rabbitmq
ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server
ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop

Which is much simpler and correct.  It also avoids the pacemaker issue where it does not wait on ExecStartPost, although pacemaker seems to have a separate issue with sd_notify as well, as I've noted in the pacemaker bug.  So even this alone will not truly fix the issue.

This is not absolutely critical for GA.  I am working on some workarounds in the pacemaker puppet code right now that should hopefully make this work with the current service.  This should definitely be fixed for A1, but it would still be nice to fix it sooner.

Comment 2 John Eckersberg 2014-08-28 19:44:13 UTC
I've got a scratch build of this that does not require erlang-rebar in order to build.  That package brings in a bunch of extra build dependencies that really are overkill.  With my build it doesn't require any extra packages beyond itself.

Comment 6 Ami Jeain 2014-11-17 15:27:11 UTC
verified using the latest tempest automation tests on rabbitmq

# rpm -qa |grep erlang-sd
erlang-sd_notify-0.1-2.el7ost.x86_64

Comment 8 errata-xmlrpc 2014-12-02 15:24:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2014-1935.html


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